Ejemplo n.º 1
0
        private void LoadCache()
        {
            if (!useCache)
            {
                NewNodeCanvas();
                return;
            }

            if (!File.Exists(lastSessionPath) || (nodeCanvas = NodeEditorSaveManager.LoadNodeCanvas(lastSessionPath, false)) == null)
            {
                NewNodeCanvas();
                return;
            }


            editorState = NodeEditorSaveManager.ExtractEditorState(nodeCanvas, MainEditorStateIdentifier);
            if (!UnityEditor.AssetDatabase.Contains(editorState))
            {
                NodeEditorSaveManager.AddSubAsset(editorState, lastSessionPath);
            }

            CheckCurrentCache();

            NodeEditor.RecalculateAll(nodeCanvas);
            NodeEditor.RepaintClients();
        }
Ejemplo n.º 2
0
 public void SaveSceneNodeCanvas(string path)
 {
     nodeCanvas.editorStates = new NodeEditorState[] { editorState };
     NodeEditorSaveManager.SaveSceneNodeCanvas(path, ref nodeCanvas, true);
     editorState = NodeEditorSaveManager.ExtractEditorState(nodeCanvas, MainEditorStateIdentifier);
         #if UNITY_EDITOR
     if (useCache)
     {
         DeleteCache();
     }
         #endif
     NodeEditor.RepaintClients();
 }
Ejemplo n.º 3
0
        public void LoadNodeCanvas(string path)
        {
            if (!File.Exists(path) || (nodeCanvas = NodeEditorSaveManager.LoadNodeCanvas(path, true)) == null)
            {
                NewNodeCanvas();
                return;
            }
            editorState = NodeEditorSaveManager.ExtractEditorState(nodeCanvas, MainEditorStateIdentifier);

            openedCanvasPath = path;
                #if UNITY_EDITOR
            if (useCache)
            {
                SaveCache();
            }
                #endif
            NodeEditor.RecalculateAll(nodeCanvas);
            NodeEditor.RepaintClients();
        }
Ejemplo n.º 4
0
 public void SetCanvas(NodeCanvas canvas)
 {
     nodeCanvas  = canvas;
     editorState = NodeEditorSaveManager.ExtractEditorState(nodeCanvas, MainEditorStateIdentifier);
     NodeEditor.RepaintClients();
 }