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
The type of the window. Must derive from EditorWindow.
Set this to true, to create a floating utility window, false to create a normal window.
If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.
Whether to give the window focus, if it already exists. (If GetWindow creates a new window, it will always get focus).
Returns
Type | Description |
|---|---|
| EditorWindow | An EditorWindow instance of windowType. |
Remarks
If there is none, creates and shows new window and returns the instance of it.

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 |
|---|---|
| T | An 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
Set this to true, to create a floating utility window, false to create a normal window.
Returns
Type | Description |
|---|---|
| T | An 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
Returns
Type | Description |
|---|---|
| T | An 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
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 |
|---|---|
| T | An 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
Returns
Type | Description |
|---|---|
| T | An 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
Set this to true, to create a floating utility window, false to create a normal window.
If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.
Whether to give the window focus, if it already exists. (If GetWindow creates a new window, it will always get focus).
Returns
Type | Description |
|---|---|
| T | An 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
An array of EditorWindow types that the window will attempt to dock onto.
Returns
Type | Description |
|---|---|
| T | An 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
Returns
Type | Description |
|---|---|
| T | An 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
If GetWindow creates a new window, it will get this title. If this value is null, use the class name as title.
Whether to give the window focus, if it already exists. (If GetWindow creates a new window, it will always get focus).
An array of EditorWindow types that the window will attempt to dock onto.
Returns
Type | Description |
|---|---|
| T | An 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.