Setup Wizard
Tools > UI Toolbox > Setup Wizard sets up a workspace scene in five steps: Welcome, Files, Windows, Scene objects and Summary. The wizard is an EditorWindow made with the Toolbox Wizard control. ToolboxSceneSetup.Create(options) (assembly UIToolbox.Editor) does the work, so your editor code can call it too.
- It writes
{Name}.uxmlwith a workspace, an optional toolbar and the windows. The first window starts open. - With scene objects, it writes
{Name}Detail.uxmlwith a label for each public field of the first object's script, and adds anWindowTemplateElementwith the iddetail. - It adds a GameObject
{Name} UIwith aUIDocumentto the active scene. It takes the given panel settings, else the first in the project, else it makes one. - It adds
OpenWindowOnClickto each scene object, and aBoxColliderwhen the object has no collider. - It never replaces a file. The scene changes are one undo step.
ToolboxSceneSetup.Validatereturns the problems with the options: a folder outside Assets, a bad name, an existing file, or two windows with the same id.