Files
2026-05-26 16:15:54 +08:00

125 lines
3.6 KiB
C#

using asap.core;
using cfg;
using Cinemachine;
using GameCore;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace game
{
public class WashingGameReview : WashingGameBase
{
#region
private EventWashingPanel panel;
private void InitPanel()
{
panel.SetDataManager(m_DataManager);
if (m_DataManager.HaveNextEventStep())
{
panel.ShowForShipOver();
}
else
{
m_DataManager.WashingData.IsAllGameOver = true;
panel.ShowForAllGameOver();
}
// 设置预览按钮
panel.SetBtnPreviewClickListener(null);
bool have = m_DataManager.HaveNextEventStep();
bool haveNextEventStep = false;
if (m_DataManager != null && m_DataManager.WashingData != null)
haveNextEventStep = m_DataManager.HaveNextEventStep();
// 设置关闭按钮
panel.SetBtnCloseClickListener(haveNextEventStep ? GoToNextStep : OnBtnCloseClickListener);
// 关闭笔刷填充进度
panel.ResetBrushChannelCounterFillAndInverse(false, false);
m_IsGuiding = panel.InitGuidance();
}
private void GoToNextStep()
{
GContext.Publish(new RewardPanelClose());
}
private void OnBtnCloseClickListener()
{
// 关闭当前Act
GContext.Publish(new UnloadActToNextAct());
}
#endregion
#region
public override void InitGame(string name)
{
base.InitGame(name);
this.m_GameType = EventWashingOperation.Review;
}
public async override void EnterGame()
{
base.EnterGame();
// 打开页面(UI)
GameObject pannelObj = await UIManager.Instance.ShowUI(UITypes.EventWashingPanel);
panel = pannelObj.transform.GetComponent<EventWashingPanel>();
InitPanel();
if (m_CameraMoveController != null)
{
m_CameraMoveController.enabled = true;
}
AfterEnterGame();
}
public override void ResetAndInitData(CinemachineVirtualCamera virtualCamera, CameraFollowPathMoveController cameraFollowPathMoveController, OperatingToolsBase tool)
{
if (virtualCamera != null)
{
m_VirtualCamera = virtualCamera;
if (m_CameraFocusedTransform != null)
{
m_VirtualCamera.LookAt = m_CameraFocusedTransform;
}
}
if (cameraFollowPathMoveController != null && m_CameraPath != null && m_RestIndexList != null)
{
m_CameraMoveController = cameraFollowPathMoveController;
m_CameraMoveController.ResetAndInit(m_CameraPath, m_RestIndexList, m_MagneticDistance);
if (m_CameraMoveController.Path.Looped == true)
{
m_CameraMoveController.IsAlwaysMoving = true;
}
m_CameraMoveController.Speed = m_CameraSpeed;
}
}
public override void GameOver()
{
if (m_CameraMoveController.Path.Looped == true)
{
m_CameraMoveController.IsAlwaysMoving = false;
}
base.GameOver();
}
protected override void Update()
{
base.Update();
if (panel != null)
panel.ContinuousOperation();
}
#endregion
}
}