/// <summary> /// Refresh all states, recreate the StateGUI list. /// </summary> public override void Refresh() { // Create the guiStates m_StatesGUI = null; var activeFsm = BehaviourWindow.activeFsm; if (activeFsm != null) { var guiStates = new List <StateGUI>(); // Add states var states = activeFsm.states; if (states != null) { for (int i = 0; i < states.Count; i++) { // Create and adds a new stateGUI guiStates.Add(new StateGUI(guiStates.Count, states[i])); } } m_StatesGUI = guiStates.ToArray(); } CalculateViewRect(); StateGUI.ResetDraggedWindow(); }
/// <summary> /// A Unity callback called when the object will be destroyed. /// Reset the guiState dragged window to avoid erros in the blackboard view ignore events and the GUIBehaviourTree. /// </summary> void OnDestroy() { StateGUI.ResetDraggedWindow(); }