优化代码

This commit is contained in:
2024-10-26 22:42:24 +08:00
parent f4f01e9e59
commit 71b922fe6b
10 changed files with 562 additions and 27 deletions

View File

@@ -34,6 +34,7 @@ namespace Views{
public override async void OnOpenView(IC_ViewData parameters)
{
MapContent.Instance.PlayerEntity.gameObject.SetActive (false);
this.nextBtn.gameObject.SetActive (false);
var index = parameters.GetValue<int> ();
this.lastFragment.SetActive (false);
@@ -65,22 +66,27 @@ namespace Views{
{
this.nextBtn.onClick.AddListener (() =>
{
UIManager.Instance.OpenLoading (() =>
if (RoomManager.Instance.PartIndex < 3)
{
UIManager.Instance.OpenLoading (() =>
{
this.ViewConnector.CloseView ();
{
Destroy (MapContent.Instance.ScenePart.gameObject);
MapContent.Instance.ScenePart = null;
RoomManager.Instance.PartIndex++;
GameEventDefine.ChangeGameFsm.SendMessage (GameState.StartGame);
}
});
}
else
{
this.ViewConnector.CloseView ();
if (RoomManager.Instance.PartIndex < 3)
{
Destroy (MapContent.Instance.ScenePart.gameObject);
MapContent.Instance.ScenePart = null;
RoomManager.Instance.PartIndex++;
GameEventDefine.ChangeGameFsm.SendMessage (GameState.StartGame);
}
else
{
//播放结尾gc动画
RoomManager.Instance._BossSceneDirector.Play();
}
});
Destroy (MapContent.Instance.ScenePart.gameObject);
MapContent.Instance.ScenePart = null;
//播放结尾gc动画
RoomManager.Instance._BossSceneDirector.Play();
}
});
}
// #if UNITY_EDITOR