UnityEditor.MainWindow.MakeMain C# (CSharp) Method

MakeMain() public static method

public static MakeMain ( ) : void
return void
        public static void MakeMain()
        {
            ContainerWindow window = ScriptableObject.CreateInstance<ContainerWindow>();
            MainWindow window2 = ScriptableObject.CreateInstance<MainWindow>();
            window2.SetMinMaxSizes(new Vector2(770f, 300f), new Vector2(10000f, 10000f));
            window.mainView = window2;
            Resolution desktopResolution = InternalEditorUtility.GetDesktopResolution();
            int num = Mathf.Clamp((desktopResolution.width * 3) / 4, 800, 0x578);
            int num2 = Mathf.Clamp((desktopResolution.height * 3) / 4, 600, 950);
            window.position = new Rect(60f, 20f, (float) num, (float) num2);
            window.Show(ShowMode.MainWindow, true, true);
            window.DisplayAllViews();
        }

Usage Example

示例#1
0
 public static void EnsureMainWindowHasBeenLoaded()
 {
     if (Resources.FindObjectsOfTypeAll(typeof(MainWindow)).Length == 0)
     {
         MainWindow.MakeMain();
     }
 }
All Usage Examples Of UnityEditor.MainWindow::MakeMain