void OnEnable() { if (windows == null) { InitSubWindows(); } // Set the window name and icon. var icon = AssetDatabase.LoadAssetAtPath <Texture2D>(ES3EditorUtility.PathToEasySaveFolder() + "Editor/Texture/es3Logo16x16.png"); titleContent = new GUIContent("Easy Save", icon); // Get the last opened window and open it. if (currentWindow == null) { var currentWindowName = EditorPrefs.GetString("ES3Editor.Window.currentWindow", windows[0].name); for (int i = 0; i < windows.Length; i++) { if (windows[i].name == currentWindowName) { currentWindow = windows[i]; break; } } } }
SubWindow SetCurrentWindow(System.Type type) { currentWindow.OnLostFocus(); currentWindow = windows.First(w => w.GetType() == type); EditorPrefs.SetString("ES3Editor.Window.currentWindow", currentWindow.name); return(currentWindow); }
public void InitSubWindows() // 这里的核心是里面这几个子UI,画图同样是调用 OnGUI { windows = new SubWindow[] { new HomeWindow(this), new SettingsWindow(this), new ToolsWindow(this), new TypesWindow(this), new AutoSaveWindow(this) }; }
void SetCurrentWindow(SubWindow window) { if (currentWindow != null) { currentWindow.OnLostFocus(); } currentWindow = window; currentWindow.OnFocus(); EditorPrefs.SetString("ES3Editor.Window.currentWindow", window.name); }
void SetCurrentWindow(System.Type type) { currentWindow = windows.First(w => w.GetType() == type); EditorPrefs.SetString("ES3Editor.Window.currentWindow", currentWindow.name); }
void SetCurrentWindow(SubWindow window) { currentWindow = window; EditorPrefs.SetString("ES3Editor.Window.currentWindow", window.name); }