diff --git a/Runtime/GameApp.Audio.cs b/Runtime/GameApp.Audio.cs index de1e0ec..5489a6a 100644 --- a/Runtime/GameApp.Audio.cs +++ b/Runtime/GameApp.Audio.cs @@ -19,5 +19,5 @@ public static partial class GameApp } } - private static IAudioModule _audio; + internal static IAudioModule _audio; } diff --git a/Runtime/GameApp.Event.cs b/Runtime/GameApp.Event.cs index ecfb9db..49c5473 100644 --- a/Runtime/GameApp.Event.cs +++ b/Runtime/GameApp.Event.cs @@ -20,5 +20,5 @@ public static partial class GameApp } } - private static IEventModule _event; + internal static IEventModule _event; } diff --git a/Runtime/GameApp.Fsm.cs b/Runtime/GameApp.Fsm.cs index 15f9a18..b18194d 100644 --- a/Runtime/GameApp.Fsm.cs +++ b/Runtime/GameApp.Fsm.cs @@ -19,5 +19,5 @@ public static partial class GameApp } } - private static IFsmModule _fsm; + internal static IFsmModule _fsm; } diff --git a/Runtime/GameApp.Localization.cs b/Runtime/GameApp.Localization.cs index f23365a..f21866b 100644 --- a/Runtime/GameApp.Localization.cs +++ b/Runtime/GameApp.Localization.cs @@ -19,5 +19,5 @@ public static partial class GameApp } } - private static ILocalizationModule _localization; + internal static ILocalizationModule _localization; } diff --git a/Runtime/GameApp.Network.cs b/Runtime/GameApp.Network.cs index f0006be..9292671 100644 --- a/Runtime/GameApp.Network.cs +++ b/Runtime/GameApp.Network.cs @@ -20,5 +20,5 @@ public static partial class GameApp } } - private static INetworkModule _network; + internal static INetworkModule _network; } diff --git a/Runtime/GameApp.ObjectPool.cs b/Runtime/GameApp.ObjectPool.cs index 09ac790..7591f2a 100644 --- a/Runtime/GameApp.ObjectPool.cs +++ b/Runtime/GameApp.ObjectPool.cs @@ -19,5 +19,5 @@ public static partial class GameApp } } - private static IObjectPoolModule _objectPool; + internal static IObjectPoolModule _objectPool; } diff --git a/Runtime/GameApp.Procedure.cs b/Runtime/GameApp.Procedure.cs index 9da620e..187db49 100644 --- a/Runtime/GameApp.Procedure.cs +++ b/Runtime/GameApp.Procedure.cs @@ -19,5 +19,5 @@ public static partial class GameApp } } - private static IProcedureModule _procedure; + internal static IProcedureModule _procedure; } diff --git a/Runtime/GameApp.Resource.cs b/Runtime/GameApp.Resource.cs index 032bb14..eef1990 100644 --- a/Runtime/GameApp.Resource.cs +++ b/Runtime/GameApp.Resource.cs @@ -20,5 +20,5 @@ public static partial class GameApp } } - private static IResourceModule _resource; + internal static IResourceModule _resource; } diff --git a/Runtime/GameApp.Scene.cs b/Runtime/GameApp.Scene.cs index 07b6c82..ea8a287 100644 --- a/Runtime/GameApp.Scene.cs +++ b/Runtime/GameApp.Scene.cs @@ -19,6 +19,6 @@ public static partial class GameApp } } - private static ISceneModule _scene; + internal static ISceneModule _scene; } diff --git a/Runtime/GameApp.Timer.cs b/Runtime/GameApp.Timer.cs index 147f0f0..256fbdf 100644 --- a/Runtime/GameApp.Timer.cs +++ b/Runtime/GameApp.Timer.cs @@ -19,5 +19,5 @@ public static partial class GameApp } } - private static ITimerModule _timer; + internal static ITimerModule _timer; } diff --git a/Runtime/GameApp.UI.cs b/Runtime/GameApp.UI.cs index e8ed075..f051607 100644 --- a/Runtime/GameApp.UI.cs +++ b/Runtime/GameApp.UI.cs @@ -19,5 +19,5 @@ public static partial class GameApp } } - private static IUIModule _ui; + internal static IUIModule _ui; } diff --git a/Runtime/GameApp.cs b/Runtime/GameApp.cs index be20151..7fb2f45 100644 --- a/Runtime/GameApp.cs +++ b/Runtime/GameApp.cs @@ -18,5 +18,5 @@ public static partial class GameApp } } - private static RootModule _base; + internal static RootModule _base; } diff --git a/Runtime/GameAppStaticMemberReset.cs b/Runtime/GameAppStaticMemberReset.cs new file mode 100644 index 0000000..6b1ef5c --- /dev/null +++ b/Runtime/GameAppStaticMemberReset.cs @@ -0,0 +1,36 @@ +#if UNITY_EDITOR +using System.Reflection; +using AlicizaX.EventKit; +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._event = null; + GameApp._fsm = null; + GameApp._localization = null; + GameApp._network = null; + GameApp._objectPool = null; + GameApp._procedure = null; + GameApp._resource = null; + GameApp._scene = null; + GameApp._timer = null; + GameApp._ui = null; + } +} + +#endif diff --git a/Runtime/GameAppStaticMemberReset.cs.meta b/Runtime/GameAppStaticMemberReset.cs.meta new file mode 100644 index 0000000..0c1eecb --- /dev/null +++ b/Runtime/GameAppStaticMemberReset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a0120d62fb8349d58e950bdaa50145e4 +timeCreated: 1743593118 \ No newline at end of file