Extending the Add Tab menu

15826-help1.png

How would I go about adding another option into this tab? I would like to open a custom EditorWindow from here but I can’t find anything on the subject. I’m thinking the MenuItem command needs to be used but the docs don’t specify all of the context commands you can use in it.

It’s not possible as far as i can tell. The AddTab menu is part of the DockArea class which uses the function “GetPaneTypes” to build the tab-list.

The function is hardcoded like this:

protected Type[] GetPaneTypes()
{
	return new Type[]
	{
		typeof(SceneView),
		typeof(GameView),
		typeof(InspectorWindow),
		typeof(HierarchyWindow),
		typeof(ObjectBrowser),
		typeof(ProfilerWindow),
		typeof(AnimationWindow)
	};
}

Unfortunately the function creates the array on-the-fly, so it’s not possible to extend it via reflection. The only way would be to decompile the whole UnityEditor dll and manipulate the code directly (which isn’t worth it)

You can override this now!