Creating a switchable EditorWindow Like the Lighting Tab

Hello,

I am trying to create an EditorWindow that works on objects in assets and on objects in the scene but differentiate between those two usages. The options should be a bit different, so I want to create a toggle that enables switching between two different GUI setups.
Does anybody know how I can create toggle buttons similar to the Lighting Tab (see top of appended image)?

Thanks for any help!

You can do it like this:

private int m_tab;
private void OnGUI()
{
    m_tab = GUILayout.Toolbar(m_tab, new string[] { "Scene", "Global Maps", "Object Maps" }, "LargeButton");
    switch(m_tab)
    {
        case 0:
            //Scene
            break;
        case 1:
            //Global Maps
            break;
        case 2:
            //Object Maps
            break;
    }
}
1 Like

Thanks a lot!