mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
单例系统完善生命周期、支持Dispose
This commit is contained in:
@@ -19,7 +19,7 @@ public partial class GameApp:Singleton<GameApp>
|
||||
_hotfixAssembly = (List<Assembly>)objects[0];
|
||||
Log.Warning("======= 看到此条日志代表你成功运行了热更新代码 =======");
|
||||
Log.Warning("======= Entrance GameApp =======");
|
||||
Instance.Init();
|
||||
Instance.Active();
|
||||
Instance.Start();
|
||||
Utility.Unity.AddUpdateListener(Instance.Update);
|
||||
Utility.Unity.AddFixedUpdateListener(Instance.FixedUpdate);
|
||||
@@ -60,8 +60,9 @@ public partial class GameApp:Singleton<GameApp>
|
||||
Utility.Unity.RemoveDestroyListener(Instance.OnDestroy);
|
||||
Utility.Unity.RemoveOnDrawGizmosListener(Instance.OnDrawGizmos);
|
||||
Utility.Unity.RemoveOnApplicationPauseListener(Instance.OnApplicationPause);
|
||||
return;
|
||||
}
|
||||
|
||||
SingletonSystem.Release();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
Reference in New Issue
Block a user