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 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(); }