private static void InitializeOnLoadMethod()
        {
            ManagedLog.LogMethod(type: ManagedLog.Type.Structure);

            PlayerLoopUtilities.AppendToPlayerLoop <Update.ScriptRunBehaviourUpdate>(typeof(BasicStateMachineEngine), Update);
#if UNITY_EDITOR
            EditorApplication.playModeStateChanged += OnEditorApplicationOnPlayModeStateChanged;
#endif
        }
示例#2
0
        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
        }
示例#3
0
        private static void Initialize()
        {
            _isInit = true;
            SceneManager.sceneLoaded += OnEditorSceneManagerOnSceneLoaded;
            ListenCamera();

            PlayerLoopUtilities.AppendToPlayerLoop <Update.ScriptRunBehaviourUpdate>(typeof(DebugDraw), CustomLateUpdate);

            // Default Drawings
            if (SHOW_ORIGIN_DATA)
            {
                DefaultDrawings.Add(new PointDrawing(Vector3.zero, .5f, 0.02f, isAxisColored: true));
                DefaultDrawings.Add(new TextDrawing(new Vector3(.02f, .01f), nameof(DebugDraw),
                                                    new Color(1f, 0.84f, 0.2f), fontSize: .5f,
                                                    textAlign: TextAlign.BottomLeft, lookAtCamera: false)); // Not working consistently, maybe just in edit mode
            }
        }
        private static void InitializeOnLoadMethod()
        {
            ManagedLog.LogMethod(type: ManagedLog.Type.Structure);

            PlayerLoopUtilities.AppendToPlayerLoop <Update.ScriptRunBehaviourUpdate>(typeof(ManagedLog), LateUpdate);
        }