Ejemplo n.º 1
0
        public static bool OnOpen(int instanceID, int line)
        {
            NodeGraph nodeGraph = EditorUtility.InstanceIDToObject(instanceID) as NodeGraph;

            if (nodeGraph == null)
            {
                return(false);
            }

            NodeEditorWindow window = (NodeEditorWindow)GetWindow(typeof(NodeEditorWindow), false, "RPG Node Editor", true);

            window.wantsMouseMove = true;
            window.Graph          = nodeGraph;
            return(true);
        }
Ejemplo n.º 2
0
        //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();
            }
        }