private static void OnEditorApplicationOnPlayModeStateChanged(PlayModeStateChange change) { if (change != PlayModeStateChange.ExitingPlayMode) { return; } ManagedLog.LogMethod(type: ManagedLog.Type.Structure); StateMachines.Clear(); }
private static void InitializeOnLoadMethod() { ManagedLog.LogMethod(type: ManagedLog.Type.Structure); PlayerLoopUtilities.AppendToPlayerLoop <Update.ScriptRunBehaviourUpdate>(typeof(BasicStateMachineEngine), Update); #if UNITY_EDITOR EditorApplication.playModeStateChanged += OnEditorApplicationOnPlayModeStateChanged; #endif }
private static void InitializeOnLoadMethod() { ManagedLog.LogMethod(type: ManagedLog.Type.Structure); SceneManager.sceneLoaded += SceneManagerOnSceneLoaded; SceneManager.sceneUnloaded += SceneManagerOnSceneUnloaded; PlayerLoopUtilities.AppendToPlayerLoop <Update.ScriptRunBehaviourUpdate>(typeof(ManagedLog), OnUpdate); // SceneManagerOnSceneLoaded doesn't get called for initial scene in builds, we need to call it on load to capture Managed Objects #if !UNITY_EDITOR var activeScene = SceneManager.GetActiveScene(); AddAllManagedObjectsInScene(activeScene); #endif }
private static void Log(object msg) { ManagedLog.LogMethod(msg, color: Colors.PowderBlue, type: ManagedLog.Type.Structure, stackOffset: 1); }
private static void SceneManagerOnSceneUnloaded(Scene arg0) { ManagedLog.LogMethod(type: ManagedLog.Type.Structure); Views.RemoveAll(view => !view); Controllers.RemoveAll(controllerBase => !controllerBase); }
// This doesn't get called for initial scene in builds. private static void SceneManagerOnSceneLoaded(Scene scene, LoadSceneMode arg1) { ManagedLog.LogMethod(type: ManagedLog.Type.Structure); AddAllManagedObjectsInScene(scene); // TODO: We need to keep track of newly instantiated views and destroyed ones }
private static void InitializeOnEnterPlayMode() { ManagedLog.LogMethod(type: ManagedLog.Type.Structure); Controllers.Clear(); Views.Clear(); }
private static void InitializeOnLoadMethod() { ManagedLog.LogMethod(type: ManagedLog.Type.Structure); EditorSceneManager.activeSceneChangedInEditMode += OnActiveSceneChangedInEditMode; InitScene(SceneManager.GetActiveScene()); }
private static void InitializeOnLoadMethod() { ManagedLog.LogMethod(type: ManagedLog.Type.Structure); PlayerLoopUtilities.AppendToPlayerLoop <Update.ScriptRunBehaviourUpdate>(typeof(ManagedLog), LateUpdate); }
private void LogMethodTest() { ManagedLog.LogMethod(); }
protected void LogMethod(object obj = null, ManagedLog.Type type = ManagedLog.Type.Default, Object context = null) => ManagedLog.LogMethod(obj: obj, type: type, context: context, stackOffset: 1);
private static void InitializeOnEnterPlayMode(EnterPlayModeOptions options) { ManagedLog.LogMethod(type: ManagedLog.Type.Structure); StateMachines.Clear(); }