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(); }
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(); }
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(); }
public void SetCanvas(NodeCanvas canvas) { nodeCanvas = canvas; editorState = NodeEditorSaveManager.ExtractEditorState(nodeCanvas, MainEditorStateIdentifier); NodeEditor.RepaintClients(); }