- Home /
Docking EditorWindow
How can i dock my custom EditorWindow automatically when it is called on menu or when the project opens?
Thanks in advance for any idea.
Answer by ianjosephfischer · Oct 07, 2012 at 06:21 PM
Finally found this out, there is 2 ways to open editor windows.
The first way: static function GetWindow (t : System.Type, utility : boolean = false, title : String = null, focus : boolean = true) : EditorWindow
will look like :
AttachmentEditor editorWindow = (AttachmentEditor)EditorWindow.GetWindow ( typeof(AttachmentEditor), false, "Attachment Editor", true);
The dockable way: static function GetWindow. (title : String, focus : boolean, params desiredDockNextTo : System.Type[]) : T
Will look like:
AttachmentEditor editorWindow = GetWindow("Attachment Editor", true, typeof(SceneView));
Awesome! Don't know if we were all blind not to notice that overload until now, or if it was added lately. Thanks :)
Answer by Semut · Apr 06, 2011 at 04:24 PM
As far I know, it can't be done yet, even in Unity 3.3.0f4
What you can do is create custom (predefined) Unity Layout that already loaded with your custom EditorWindow, and when trying to load the layout, your custom EditorWindow will automatically docked.
At the moment you can called your custom EditorWindow and merge (docked) with another editorwindow.
Hey Semut. I'd need to merge and EditorWindow with another one, as you said it can be done. Could you write how it is done, I can't find it anywhere :)
Answer by karenkrane · Apr 21, 2013 at 03:04 PM
I know this is old, but if anyone else comes here looking for an answer, docking can be done by dragging the editor window tab, rather than the body of the window.
I know it doesn't answer the actual question, but I can't find the question for your answer from Google, only a bunch of stuff about creating in-game GUI windows. This is the best thread it takes me so far. So thank you.
Your answer
Follow this Question
Related Questions
mouseposition and clicks in editor sceneview 0 Answers
EditorWindow, Utility Popup, not using custom PropertyDrawers 0 Answers
EditorWindow reference to other scripts functions 0 Answers
Weird bug when dragging object onto EditorGUILayout.ObjectField 0 Answers
Creating Editor 2D Animation Preview 2 Answers