Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetWindow

Returns the first EditorWindow of type windowType which is currently on the screen.
Read time 5 minutesLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor

GetWindow(Type, bool, string, bool)

Returns the first EditorWindow of type windowType which is currently on the screen.
public static EditorWindow GetWindow(Type windowType, bool utility, string title, bool focus)

Parameters

windowType

The type of the window. Must derive from EditorWindow.

utility

Set this to true, to create a floating utility window, false to create a normal window.

title

If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.

focus

Whether to give the window focus, if it already exists. (If GetWindow creates a new window, it will always get focus).

Returns

Type

Description

EditorWindowAn EditorWindow instance of windowType.

Remarks

If there is none, creates and shows new window and returns the instance of it.
GetWindowEx (GetWindow)
Simple Empty non-dockable window.

Examples

using UnityEngine;using UnityEditor;// Simple script that creates a new non-dockable window.public class EditorWindowTest : EditorWindow{ [MenuItem("Examples/Display simple Window")] static void Initialize() { var window = (EditorWindowTest)EditorWindow.GetWindow(typeof(EditorWindowTest), true, "My Empty Window"); }}

GetWindow<T>()

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>() where T : EditorWindow

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it.

GetWindow<T>(bool)

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>(bool utility) where T : EditorWindow

Parameters

utility

Set this to true, to create a floating utility window, false to create a normal window.

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it.

GetWindow<T>(bool, string)

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>(bool utility, string title) where T : EditorWindow

Parameters

utility

Set this to true, to create a floating utility window, false to create a normal window.

title

If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it.

GetWindow<T>(string)

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>(string title) where T : EditorWindow

Parameters

title

If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it.

GetWindow<T>(string, bool)

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>(string title, bool focus) where T : EditorWindow

Parameters

title

If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.

focus

Whether to give the window focus, if it already exists. (If GetWindow creates a new window, it will always get focus).

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it.

GetWindow<T>(bool, string, bool)

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>(bool utility, string title, bool focus) where T : EditorWindow

Parameters

utility

Set this to true, to create a floating utility window, false to create a normal window.

title

If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.

focus

Whether to give the window focus, if it already exists. (If GetWindow creates a new window, it will always get focus).

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it.

GetWindow<T>(Type[])

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>(params Type[] desiredDockNextTo) where T : EditorWindow

Parameters

desiredDockNextTo

An array of EditorWindow types that the window will attempt to dock onto.

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it. The created window will attempt to be docked next to the first founds specified window type.

GetWindow<T>(string, Type[])

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>(string title, params Type[] desiredDockNextTo) where T : EditorWindow

Parameters

title

If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.

desiredDockNextTo

An array of EditorWindow types that the window will attempt to dock onto.

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it. The created window will attempt to be docked next to the first founds specified window type.

GetWindow<T>(string, bool, Type[])

Returns the first EditorWindow of type T which is currently on the screen.
public static T GetWindow<T>(string title, bool focus, params Type[] desiredDockNextTo) where T : EditorWindow

Parameters

title

If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.

focus

Whether to give the window focus, if it already exists. (If GetWindow creates a new window, it will always get focus).

desiredDockNextTo

An array of EditorWindow types that the window will attempt to dock onto.

Returns

Type

Description

TAn EditorWindow instance of type T.

Remarks

If there is none, creates and shows new window and returns the instance of it. The created window will attempt to be docked next to the first founds specified window type.