/// </summary> /// Register OnGUI node in editor mode. /// </summary> void RegisterEditorOnGUI() { if (!EditorApplication.isPlayingOrWillChangePlaymode) { if (m_ActionState.onGUINode != null && ((m_ActionState.isRoot && BehaviourWindow.activeState == null) || m_ActionState == BehaviourWindow.activeState)) { GUICallback.ResetCallbacks(); GUICallback.onGUI += m_ActionState.onGUINode.EditorOnTick; } } }
/// <summary> /// A Unity callback called when the object goes out of scope. /// </summary> private void OnDisable() { BehaviourWindow.activeNodeChanged -= this.ActiveNodeChanged; // Unregister the callback for visual debugging ActionNode.onNodeTick -= OnNodeTick; // Register Update if (Application.isPlaying) { EditorApplication.update -= this.Update; } else { GUICallback.ResetCallbacks(); } }