Reusable features for UI Toolkit runtime and editor.
You can generate a partial C# class from the UXML file.
Given the following UXML:
<ui:VisualElement>
<ui:Label name="title" />
</ui:VisualElement>
<ui:VisualElement name="menu">
<ui:Button name="confirm-button" />
</ui:VisualElement>
Tool generates C# script:
partial class UXMLFileName
{
private Label title;
private VisualElement menu;
private Button confirmButton;
private void AssignQueryResults(VisualElement root)
{
title = root.Q<Label>("title");
menu = root.Q<VisualElement>("menu");
confirmButton = root.Q<Button>("confirm-button");
}
}
Open from context menu: Window/UI Toolkit/Style Sheet Exporter
Available with Unity 2022.1 and newer
Ever wanted to see how Unity's built-in controls are styled?
With this tool, you can! Export style sheet assets used by Unity Editor to USS files.
Sample project: Samples/Tabs
Sample project: Samples/ReorderableCards