public void OnDisable() { keyboardState = null; graphCamera = null; if (selectionBox != null) { selectionBox.SelectionPerformed -= HandleBoxSelection; selectionBox = null; } }
public void OnEnable() { graphCamera = new GraphCamera(); keyboardState = new KeyBoardState(); selectionBox = new GraphSelectionBox(); selectionBox.SelectionPerformed += HandleBoxSelection; genericMenu = GetGenericMenu(); if (stateMachineGraph == null) { stateMachineGraph = ScriptableObject.CreateInstance <Graph>(); stateMachineGraph.hideFlags = HideFlags.HideAndDontSave; } if (stateMachineGraphGUI == null) { stateMachineGraphGUI = (GetEditor(stateMachineGraph)); } }