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();
        }
        private void SaveNewNode(Node node)
        {
            if (!useCache)
            {
                return;
            }
            if (nodeCanvas.livesInScene)
            {
                DeleteCache();
                return;
            }
            if (!nodeCanvas.nodes.Contains(node))
            {
                return;
            }

            CheckCurrentCache();

            NodeEditorSaveManager.AddSubAsset(node, lastSessionPath);
            foreach (ScriptableObject so in node.GetScriptableObjects())
            {
                NodeEditorSaveManager.AddSubAsset(so, node);
            }

            foreach (NodeKnob knob in node.nodeKnobs)
            {
                NodeEditorSaveManager.AddSubAsset(knob, node);
                foreach (ScriptableObject so in knob.GetScriptableObjects())
                {
                    NodeEditorSaveManager.AddSubAsset(so, knob);
                }
            }

            UpdateCacheFile();
        }
        private void SaveNewNodeKnob(NodeKnob knob)
        {
            if (!useCache)
            {
                return;
            }
            if (nodeCanvas.livesInScene)
            {
                DeleteCache();
                return;
            }
            if (!nodeCanvas.nodes.Contains(knob.body))
            {
                return;
            }

            CheckCurrentCache();

            NodeEditorSaveManager.AddSubAsset(knob, knob.body);
            foreach (ScriptableObject so in knob.GetScriptableObjects())
            {
                NodeEditorSaveManager.AddSubAsset(so, knob);
            }

            UpdateCacheFile();
        }