update 主程序逻辑

This commit is contained in:
2024-10-19 16:46:07 +08:00
parent 71484ea988
commit 7badf4a6af
5 changed files with 36 additions and 11 deletions

View File

@@ -47,8 +47,19 @@ namespace StateSystem.State
// return;
//初始化资源管理器并挂载AlwaysRes下的所有资源
AssetManager.Instance.Rouse ();
this._sceneLoader = new SceneLoader (SceneName.InitScene, true);
this._sceneLoader.BeginLoad (null, ManagerInit);
#if UNITY_EDITOR
ManagerInit ();
return;
#endif
if (SceneManager.GetActiveScene ().name != SceneName.InitScene.ToString ())
{
this._sceneLoader = new SceneLoader (SceneName.InitScene, true);
this._sceneLoader.BeginLoad (null, ManagerInit);
}
else
{
ManagerInit ();
}
}
protected override void OnExit ()
@@ -127,7 +138,8 @@ namespace StateSystem.State
{
GameUpdateMgr.Instance.CreateTimer (1f , () =>
{
this.stateMachineRunner.OpenState (GameGlobalState.GameLogin);
BeginStaticPanel.ReleasePanel ();
this.stateMachineRunner.OpenState (GameGlobalState.GameRoom);
});
}
}