The title says it all. I’d like to create an instance of my EditorWindow and automatically dock it somewhere, in one of the tab groups.
So far I haven’t found a documented way, but it would be very useful if possible. Does anyone know a way?
Thanks!
Orion
Old thread but stumbled across it while looking for a solution. You now can add Tabs to a window using:
Reference:
static function GetWindow. (title : String, focus : boolean, params desiredDockNextTo : System.Type[ ]) : T
Parameters
T The type of the window. Must derive from EditorWindow.
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.
In my case I wanted two custom windows to always be docked with each other. In the init for WindowA I try to make it dock to WindowB. For the init of WindowB I try to make it dock to WindowA. If the docking window does not exist, it just makes a solitary window.
Example:
[MenuItem (“Window/WindowA &a”, false, 111)]
public static void Init(){
EditorWindow window = EditorWindow.GetWindow(typeof(WindowB));
window.Show();
}