This is the main UI Builder Editor Window:
StyleSheets and the USS Selectors within in UI Toolkit are used to share and apply styles across many elements and many UI Documents (UXML).
The StyleSheets pane is where you can:
The Hierarchy pane contains the tree view representing the element hierarchy of the current document. It’s a superset of the hierarchy you see in the UXML text representation of the UI Document (UXML). Besides the elements created directly from UXML, the Hierarchy pane also contains elements created dynamically and only exist in the runtime of the UI. For example, the Hierarchy pane includes elements that are part of a Template instance (a different document instanced inside the current document), where the UXML would just has a single <Instance>
tag.
You can use the Hierarchy pane to:
Elements appear in the tree according to their name
attributes. If an element’s name
attribute is not set, it appears according to its C# type. You can double-click an element to quickly rename it.
Click the ⋮ icon in the top right corner of the Hierarchy pane header to access a menu of display options.
The Library pane is similar to the Project window in the Unity Editor. It lists available UI elements.
You can change this view mode between tiles and tree view using the ⋮ icon in the top right corner of the Library window and choosing Tree View.
.uxml
assets in the Project. It also lists any custom C# elements that inherit from VisualElement
and have their UxmlFactory
set up to be instantiable via UXML. To preview any element in the Library’s Project tab, hover over it. The preview appears to the right of the Library pane.To instantiate an element, do one of the following:
The Viewport pane displays the output of a UI Document (UXML) on a floating resizable edit-time Canvas.
Pan and zoom to navigate in the viewport. The UI Builder saves each UI Document (UXML)’s current pan and zoom state, and restores them after the UI Builder window reloads, a domain reload, or when you close and re-open the same UI Document (UXML).
When you create and open a new document, the UI Builder resets the pan and zoom states.
To pan, do one of the following:
To zoom in and out, position the mouse pointer in the Viewport and do one of the following:
As you build your UI, UI Builder automatically generates the underlying UXML and USS text, and displays them in the UXML Preview and USS Preview panes .
The UI Builder Inspector pane is similar to the Unity Inspector window. The Inspector will display slightly different content, depending on the object you have selected inside the UI Builder: