mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
GameApp Shutdown
This commit is contained in:
@@ -46,6 +46,7 @@ public partial class GameApp:Singleton<GameApp>
|
|||||||
/// <param name="shutdownType">关闭游戏框架类型。</param>
|
/// <param name="shutdownType">关闭游戏框架类型。</param>
|
||||||
public static void Shutdown(ShutdownType shutdownType)
|
public static void Shutdown(ShutdownType shutdownType)
|
||||||
{
|
{
|
||||||
|
Log.Info("GameApp Shutdown");
|
||||||
if (shutdownType == ShutdownType.None)
|
if (shutdownType == ShutdownType.None)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -128,6 +129,7 @@ public partial class GameApp:Singleton<GameApp>
|
|||||||
var logic = listLogic[i];
|
var logic = listLogic[i];
|
||||||
logic.OnDestroy();
|
logic.OnDestroy();
|
||||||
}
|
}
|
||||||
|
Shutdown(ShutdownType.Restart);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDrawGizmos()
|
private void OnDrawGizmos()
|
||||||
|
@@ -266,7 +266,7 @@ namespace TEngine
|
|||||||
{
|
{
|
||||||
if (_behaviour != null)
|
if (_behaviour != null)
|
||||||
{
|
{
|
||||||
_behaviour.Release();
|
_behaviour.Shutdown();
|
||||||
}
|
}
|
||||||
if (_entity != null)
|
if (_entity != null)
|
||||||
{
|
{
|
||||||
@@ -392,8 +392,9 @@ namespace TEngine
|
|||||||
OnApplicationPauseEvent -= fun;
|
OnApplicationPauseEvent -= fun;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Release()
|
internal void Shutdown()
|
||||||
{
|
{
|
||||||
|
DestroyEvent?.Invoke();
|
||||||
UpdateEvent = null;
|
UpdateEvent = null;
|
||||||
FixedUpdateEvent = null;
|
FixedUpdateEvent = null;
|
||||||
LateUpdateEvent = null;
|
LateUpdateEvent = null;
|
||||||
|
Reference in New Issue
Block a user