Example #1
0
        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;
                    }
                }
            }
        }
Example #2
0
 SubWindow SetCurrentWindow(System.Type type)
 {
     currentWindow.OnLostFocus();
     currentWindow = windows.First(w => w.GetType() == type);
     EditorPrefs.SetString("ES3Editor.Window.currentWindow", currentWindow.name);
     return(currentWindow);
 }
Example #3
0
 public void InitSubWindows()            // 这里的核心是里面这几个子UI,画图同样是调用 OnGUI
 {
     windows = new SubWindow[] {
         new HomeWindow(this),
         new SettingsWindow(this),
         new ToolsWindow(this),
         new TypesWindow(this),
         new AutoSaveWindow(this)
     };
 }
Example #4
0
 void SetCurrentWindow(SubWindow window)
 {
     if (currentWindow != null)
     {
         currentWindow.OnLostFocus();
     }
     currentWindow = window;
     currentWindow.OnFocus();
     EditorPrefs.SetString("ES3Editor.Window.currentWindow", window.name);
 }
Example #5
0
 void SetCurrentWindow(System.Type type)
 {
     currentWindow = windows.First(w => w.GetType() == type);
     EditorPrefs.SetString("ES3Editor.Window.currentWindow", currentWindow.name);
 }
Example #6
0
 void SetCurrentWindow(SubWindow window)
 {
     currentWindow = window;
     EditorPrefs.SetString("ES3Editor.Window.currentWindow", window.name);
 }