单例系统完善生命周期、支持Dispose

This commit is contained in:
ALEXTANG
2024-05-13 14:09:32 +08:00
parent 682a0bd786
commit f9f9122027
7 changed files with 297 additions and 9 deletions

View File

@@ -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()

View File

@@ -7,7 +7,7 @@ public partial class GameApp
{
private List<ILogicSys> _listLogicMgr;
private void Init()
public override void Active()
{
CodeTypes.Instance.Init(_hotfixAssembly.ToArray());
EventInterfaceHelper.Init();