diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/GameApp.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/GameApp.cs index 70d225da..f5707b3b 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/GameApp.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/GameApp.cs @@ -46,6 +46,7 @@ public partial class GameApp:Singleton /// 关闭游戏框架类型。 public static void Shutdown(ShutdownType shutdownType) { + Log.Info("GameApp Shutdown"); if (shutdownType == ShutdownType.None) { return; @@ -128,6 +129,7 @@ public partial class GameApp:Singleton var logic = listLogic[i]; logic.OnDestroy(); } + Shutdown(ShutdownType.Restart); } private void OnDrawGizmos() diff --git a/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Unity.cs b/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Unity.cs index e0045672..83427579 100644 --- a/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Unity.cs +++ b/UnityProject/Assets/TEngine/Runtime/Core/Utility/Utility.Unity.cs @@ -266,7 +266,7 @@ namespace TEngine { if (_behaviour != null) { - _behaviour.Release(); + _behaviour.Shutdown(); } if (_entity != null) { @@ -392,8 +392,9 @@ namespace TEngine OnApplicationPauseEvent -= fun; } - public void Release() + internal void Shutdown() { + DestroyEvent?.Invoke(); UpdateEvent = null; FixedUpdateEvent = null; LateUpdateEvent = null;