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(); } }
private static bool AutoOpenCanvas(int instanceID, int line) { if (EditorUtility.InstanceIDToObject(instanceID) is EditorCache) { OpenWindow(); curWindow.cache = EditorCache.LoadCache(AssetDatabase.GetAssetPath(instanceID)); curWindow.lastCheck = DateTime.Now; return(true); } return(false); }
EditorCache LoadnSaveAs(bool load) { string filePath = (load) ? EditorUtility.OpenFilePanel("Load Dialogue Canvas", ResourceManager.SAVEPATH, "asset") : EditorUtility.SaveFilePanelInProject("Save Dialogue Canvas", cache.CanvasName, "asset", "Select path to save Dialogue Canvas.", ResourceManager.SAVEPATH); if (string.IsNullOrEmpty(filePath)) { ShowNotification(new GUIContent("No " + (load ? "load" : "save") + " path chosen.")); return(cache); } return((load) ? EditorCache.LoadCache(filePath) : EditorCache.SaveCache(filePath, cache)); }