AlicizaX/Client/Packages/com.alicizax.unity.entry/Runtime/GameAppStaticMemberReset.cs

58 lines
1.1 KiB
C#
Raw Normal View History

2025-04-28 19:45:45 +08:00
#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;
2025-09-02 16:30:55 +08:00
#if ALICIZAX_AUDIO_SUPPORT
2025-04-28 19:45:45 +08:00
GameApp._audio = null;
2025-09-02 16:30:55 +08:00
#endif
#if ALICIZAX_EVENT_SUPPORT
2025-04-28 19:45:45 +08:00
GameApp._event = null;
2025-09-02 16:30:55 +08:00
#endif
#if ALICIZAX_FSM_SUPPORT
2025-04-28 19:45:45 +08:00
GameApp._fsm = null;
2025-09-02 16:30:55 +08:00
#endif
#if ALICIZAX_LOCALIZATION_SUPPORT
2025-04-28 19:45:45 +08:00
GameApp._localization = null;
2025-09-02 16:30:55 +08:00
#endif
2025-07-29 09:50:40 +08:00
#if ALICIZAX_NETWORK
2025-04-28 19:45:45 +08:00
GameApp._network = null;
2025-07-29 09:50:40 +08:00
#endif
2025-04-28 19:45:45 +08:00
GameApp._objectPool = null;
2025-09-02 16:30:55 +08:00
#if ALICIZAX_RESOURCE_SUPPORT
2025-04-28 19:45:45 +08:00
GameApp._resource = null;
2025-09-02 16:30:55 +08:00
#endif
#if ALICIZAX_SCENE_SUPPORT
2025-04-28 19:45:45 +08:00
GameApp._scene = null;
2025-09-02 16:30:55 +08:00
#endif
#if ALICIZAX_TIMER_SUPPORT
2025-04-28 19:45:45 +08:00
GameApp._timer = null;
2025-09-02 16:30:55 +08:00
#endif
#if ALICIZAX_UI_SUPPORT
2025-04-28 19:45:45 +08:00
GameApp._ui = null;
2025-09-02 16:30:55 +08:00
#endif
2025-04-28 19:45:45 +08:00
}
}
#endif