Today we’re highlighting an upcoming feature that the Scene Tooling team has been working on. Please keep in mind that the details outlined in this discussion post are subject to change, and we cannot share a release version at this time. We want to take your feedback into consideration.
The main toolbar provides several UI elements that are critical to the editor workflow and stays on your screen regardless of the window layout in your editor. Although there is a lot of unused real estate, the toolbar has largely stayed the same between iterations of the Unity Editor.
It has been widely requested to allow developers to extend the main toolbar with custom UI elements. Some clever users have discovered hacks to achieve this, but we would like to provide a robust ecosystem for customizing the main toolbar easily and safely. We want developers to leverage the main toolbar, organize it the way they want, and create presets for specific workflows such as level design or animation.
Rearrange Toolbar Elements
The main toolbar has been divided into three dock zones: the left, middle, and right. Toolbar elements can be rearranged and reordered.
Hide/Show Toolbar Elements
Elements in the main toolbar can be hidden or shown.
Overflow
When the toolbar elements overflow the main toolbar, the toolbar will elegantly transform into a scroll zone.
Extend Toolbar with Custom Elements
We are exposing the API to extend the main toolbar. We have designed this API to be simple yet powerful, requiring minimal code and no knowledge of Unity’s UI stack. The API docs will include code examples demonstrating how to create both simple and complex elements for the main toolbar.
[MainToolbarElement("Build Settings")]
static MainToolbarElementInfo CreateBuildSettingsButton()
{
return new MainToolbarButtonInfo(new GUIContent("Build Settings"), OpenBuildSettingsWindow);
}
Currently the API allows for the creation of buttons, dropdown menus, toggles, and groups of these elements. We want to release this initial version with a small set of UI element types and refine the overall user experience before considering additional types. If there are specific use cases you’d like to see supported by this API, please let us know.
Presets
Users can save and load presets to quickly switch between workflows. These can also be exported to be shared with other users.
Please keep in mind that the features outlined above are subject to change. We hope you enjoyed this preview, and we look forward to hearing your feedback.