public override void OnGUI() { if (_graph == null) { return; } if (Event.current.keyCode == KeyCode.T && Event.current.control) { Select(this, false); } PreCache(); //Blackboard.Instance.CurrentLocalVariableInventory = _graph.GetVariableInventory(); GraphEditor = NodeGraphEditor.GetEditor(_graph); GraphEditor.Rect = position; DrawGrid(); Utilities.BeginZoom(position, Zoom, TopPadding); DrawNodes(); DrawConnections(); DrawHeldConnection(); Utilities.EndZoom(position, Zoom, TopPadding); DrawSelectionBox(); DrawChildWindows(); CheckHoveringAndSelection(); GraphEditor.OnGUI(); HandleGUIEvents(); ResetCache(); }
//public static void RepaintAll() //{ // NodeEditorWindow[] windows = Resources.FindObjectsOfTypeAll<NodeEditorWindow>(); // foreach (var window in windows) window.Repaint(); //} protected override void OnFocus() { base.OnFocus(); CurrentNodeEditorWindow = this; if (_graph == null) { return; } _graphEditor = NodeGraphEditor.GetEditor(_graph); //Blackboard.Instance.CurrentLocalVariableInventory = _graph.GetVariableInventory(); if (_graphEditor != null) { NodeEditorUtilities.AutoSaveAssets(); } }