public void OnGUI()
        {
            CanvasGUI.Position = position;

            if (DateTime.Now - lastCheck >= ResourceManager.CheckRate)
            {
                if (!EditorCache.ValidateCanvas(cache))
                {
                    Debug.LogWarning("Loading last opened session.");
                    InitCanvas();
                    cache = EditorCache.LoadCache();
                }
                else
                {
                    cache.Init();
                }
                lastCheck = DateTime.Now;
            }

            InputSystem.EarlyInputEvents(cache.States);
            DialogueEditorGUI.OnGUI(cache.States);
            ToolBar();
            InputSystem.LateInputEvents(cache.States);
            cache.States.UpdateEvents();

            if (openDebug = CanvasGUI.Toggle(new Rect(5, 5, 130, 20), new GUIContent("Debug Window"), openDebug))
            {
                DebuggerWindow();
            }
        }
Beispiel #2
0
 public static EditorCache SaveCache(string filePath, EditorCache cache)
 {
     if (filePath == ResourceManager.TEMPFILEPATH)
     {
         Debug.LogWarning("Dont be saving stuff here dawg. plox file somewhere else to saving.");
         return(cache);
     }
     cache          = SaveManager.SaveCanvas(filePath, cache.IsFileSaved, cache);
     cache.SavePath = filePath;
     cache.Init();
     return(cache);
 }
Beispiel #3
0
        public static EditorCache LoadCache(EditorCache loadedCache)
        {
            EditorCache cache = CreateInstance <EditorCache> ();

            cache.Nodes      = loadedCache.Nodes;
            cache.Actors     = loadedCache.Actors;
            cache.Conditions = loadedCache.Conditions;
            cache.States     = loadedCache.States;

            SaveManager.SaveCanvas(ResourceManager.TEMPFILEPATH, true, cache);
            cache.Init();
            return(cache);
        }
Beispiel #4
0
        public static EditorCache NewCache()
        {
            EditorCache cache = CreateInstance <EditorCache> ();

            cache.CanvasName = "New Canvas";
            cache.Actors     = ActorDatabase.CreateNew <ActorDatabase> (cache.CanvasName);
            cache.Conditions = ConditionDatabase.CreateNew <ConditionDatabase> (cache.CanvasName);
            cache.Nodes      = NodeDatabase.CreateNew <NodeDatabase> (cache.CanvasName);
            cache.States     = new EditorStates(cache);

            cache.Init();
            SaveManager.SaveCanvas(ResourceManager.TEMPFILEPATH, false, cache);
            return(cache);
        }