void InitializeGraph() { // This Object should not be destroyed if the scene changed or if the editor switched the PlayMode. hideFlags = HideFlags.HideAndDontSave; // set the instance to the current open window. // instance is null if Unity starts and the window is open. instance = this; m_canvas = new NodeCanvas(this); m_eventSystem = new EventSystem(this); m_historyPanel = new HistoryPanel(this, Repaint); m_logPanel = new LogPanel(this, Repaint); m_statsPanel = new StatisticsPanel(this, Repaint); EditorApplication.wantsToQuit -= UnityWantsToQuit; EditorApplication.wantsToQuit += UnityWantsToQuit; EditorApplication.playModeStateChanged -= EditorApplicationOnPlayModeStateChanged; EditorApplication.playModeStateChanged += EditorApplicationOnPlayModeStateChanged; Selection.selectionChanged -= LoadSelectedController; Selection.selectionChanged += LoadSelectedController; SceneView.onSceneGUIDelegate -= OnSceneGUI; SceneView.onSceneGUIDelegate += OnSceneGUI; #if GRAPH_DEBUG Debug.Log("[AI Graph]: Graph initialized"); #endif }
public HistoryPanel(AIGraph graph, Action repaintCallback) { m_graph = graph; m_repaintCallback = repaintCallback; GraphUndo.onRecordsChanged -= Repaint; GraphUndo.onRecordsChanged += Repaint; }
public EventSystem(AIGraph graph) { m_graph = graph; m_instance = this; LoadEvents(); }
public static void Open() { #if GRAPH_DEBUG if (instance == null) { Debug.Log("[AI Graph]: Open Graph"); } #endif instance = GetWindow <AIGraph> (); instance.titleContent = new GUIContent("AI Graph"); instance.minSize = new Vector2(680, 390); }
public LogPanel(AIGraph graph, Action repaintCallback) { m_graph = graph; m_repaintCallback = repaintCallback; }