Beispiel #1
0
        /// <summary>
        /// Makes sure the current canvas is saved to the cache
        /// </summary>
        private void CheckCurrentCache()
        {
#if UNITY_EDITOR
            if (!useCache)
            {
                return;
            }
#if EDITOR_CACHE_ASSET
            if (nodeCanvas.livesInScene)
            {
                if (NodeEditorSaveManager.FindOrCreateSceneSave("lastSession").savedNodeCanvas != nodeCanvas)
                {
                    LogMgr.LogError("Cache system error: Current scene canvas is not saved as the temporary cache scene save!");
                }
            }
            else if (UnityEditor.AssetDatabase.GetAssetPath(nodeCanvas) != lastSessionPath)
            {
                LogMgr.LogError("Cache system error: Current asset canvas is not saved as the temporary cache asset!");
            }
#else
            if (nodeCanvas.livesInScene)
            {
                if (NodeEditorSaveManager.FindOrCreateSceneSave("lastSession").savedNodeCanvas == null)
                {
                    SaveCache();
                }
            }
            else if (UnityEditor.AssetDatabase.LoadAssetAtPath <NodeCanvas>(lastSessionPath) == null)
            {
                SaveCache();
            }
#endif
#endif
        }