com.alicizax.unity.entry/Runtime/GameAppStaticMemberReset.cs
2025-09-08 11:18:14 +08:00

36 lines
817 B
C#

#if UNITY_EDITOR
using UnityEditor;
internal static class GameAppStaticMemberReset
{
static GameAppStaticMemberReset()
{
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
}
private static void OnPlayModeStateChanged(PlayModeStateChange state)
{
if (state == PlayModeStateChange.ExitingPlayMode)
ResetAllEventContainers();
}
private static void ResetAllEventContainers()
{
GameApp._base = null;
GameApp._audio = null;
GameApp._fsm = null;
GameApp._localization = null;
#if ALICIZAX_NETWORK
GameApp._network = null;
#endif
GameApp._objectPool = null;
GameApp._resource = null;
GameApp._scene = null;
GameApp._timer = null;
GameApp._ui = null;
}
}
#endif