private void OnDestroy() { thisWindow = null; EditorApplication.hierarchyWindowChanged -= OnHierarchyChanged; SceneView.onSceneGUIDelegate -= OnScene; Undo.undoRedoPerformed -= UndoRedoCallback; EditorApplication.playmodeStateChanged -= PlayModeStateChanged; EditorApplication.update -= SequenceUpdate; StopProcessingAnimationMode(); if (CurrentSequence) { CurrentSequence.Stop(); } }
private void OnEnable() { showAnimationModeTime = EditorApplication.timeSinceStartup; thisWindow = this; hideFlags = HideFlags.HideAndDontSave; if (ContentRenderer == null) { ContentRenderer = ScriptableObject.CreateInstance <JContent>(); } ContentRenderer.SequenceWindow = this; EditorApplication.hierarchyWindowChanged -= OnHierarchyChanged; EditorApplication.hierarchyWindowChanged += OnHierarchyChanged; SceneView.onSceneGUIDelegate -= OnScene; SceneView.onSceneGUIDelegate += OnScene; Undo.undoRedoPerformed -= UndoRedoCallback; Undo.undoRedoPerformed += UndoRedoCallback; EditorApplication.playmodeStateChanged -= PlayModeStateChanged; EditorApplication.playmodeStateChanged += PlayModeStateChanged; EditorApplication.update -= SequenceUpdate; EditorApplication.update += SequenceUpdate; }