
Discover Unity's UI toolkit, a brand-new UI system in 2022 releases, that isolates UI, separates layout, styling, and functionality, and adds Flexbox layout and a robust event system.
Discover how Unity UI toolkit compares to older UI systems and why it’s the recommended approach for new UI development in game projects.
Explore the Unity UI Toolkit workflow, its three parts, produced files, and how to connect them to Unity games, with a web style HTML, CSS, and JavaScript analogy.
Layout the UI by adding elements, arranging them in a hierarchy, and setting properties; save your work as an XML file that captures the UI toolkit layout and hierarchy.
Connect UI Toolkit layouts to a Unity scene by attaching a UI document, selecting the layout as source asset, and adding a script to enable button functionality in play mode.
Explore how posters summarize each section and guide you to skip non-crucial lessons, while recognizing three learner types and crucial lessons introducing new UI Toolkit concepts.
Explore why Unity uses XML files to store UI layout and how a visual tree maps to XML, enabling a compact, hierarchical representation of nested elements for scalable UI design.
Learn how visual trees model UI as parent–child hierarchies to enable efficient traversal, reuse of subtrees, and clear rendering of overlapping elements in Unity's UI toolkit.
Learn to style Unity UI toolkit elements with UI Builder: edit, save, and reuse styles, extract inline styles to new classes, and apply via drag-and-drop and selectors.
Explore selector precedence and specificity in UI Toolkit styling. See how type, class, and ID selectors compete, and how the wildcard star selector fits in and influences sizes.
Unleash stylesheet superpowers in unity ui toolkit with type selectors, id selectors, and child selectors. Color labels and demonstrate direct child and any depth selectors, highlighting specificity and inline styles.
Master pseudo selectors, especially hover, and test them in preview mode in Unity UI Toolkit. Learn direct child and descendant selectors and how style sheets shape the UI workflow.
Bring together a simple c sharp script with the Unity UI Toolkit to give a button a basic function and preview the first real runtime UI in the game view.
Learn how flexbox relies on the main axis, cross axis, and flex direction to apply axis-specific rules in a 2d layout, with naming that can redefine orientation.
Learn how Unity's flex direction switches the main axis between column and row, guiding element alignment along the main axis and shaping the cross axis through container rules.
Explore how flex direction switches the main axis between row and column in the UI Builder. Observe how row, column, and reverse settings affect item order and alignment.
Master flex basis, shrink, and grow as a unified trio in flexbox, understanding how basis acts like width on the main axis, auto behavior, and values like 200px or 300px.
Explains how flex basis in flexbox shapes item sizes under constraints, comparing pixel, percentage, and auto values, and shows how content and neighboring items determine sizes through flex space weight.
Examine how the three properties shrink, grow, and flex basis interact to adjust element sizes as the container changes, shrinking or growing proportionally until reaching the flex basis threshold.
Understand how flex grow values govern relative resizing, using unitless ratios where grow two expands twice as much as grow one, and grow three expands three times as much.
Override flexbox layouts by using absolute and relative positioning to place overlays, pop-up windows, and draggable elements, stacking them above other content without affecting the underlying layout.
Set up a multi-panel Unity UI with UI Toolkit, arranging four panels in a row with specific flex basis values, margins, and padding, and style them via a style sheet.
Learn to add basic functionality to a button in Unity UI Toolkit by wiring a C# script to the UI document and make the box resize randomly on click.
Explore text labels in Unity UI Toolkit, change fonts via font assets or ttf imports, enable rich text, and update label text with scripts.
Practice simple controls in Unity UI Toolkit by setting up text and images, configuring fonts from Google Fonts, and adjusting a two-panel layout with margins and radii.
Learn to use the Unity UI Toolkit documentation to quickly identify properties and methods by tracing inheritance from visual element to button.
Learn to inspect and manipulate visual elements in Unity UI Toolkit scripts, including root element, container, layout properties, and runtime debugging to see elements after rendering.
Load and instantiate templates at runtime with Unity UI Toolkit by scripting, placing template assets in a resources folder and adding instances to a card container.
Load assets in scripts by importing images as sprites from the resources folder, apply them to avatar visuals, and dynamically load style sheets and borders using UI toolkit templates.
Create and reuse templates to represent repeating UI elements, such as a middle batch badge, with locked and unlocked variants, adjust alignment and padding, and apply templates across the project.
Explore how to use the ui toolkit query builder with visual elements to select by type, class, and hierarchy. See live results in the game view during runtime.
Explore how the UI toolkit's query builder selects single elements or lists with name and off type filters, and how chaining accumulates results, prompting dedicated builders and Q convenience classes.
Master the where query in UI toolkit to filter elements with a lambda predicate, enabling labels by text, colors, sizes, and custom properties, with chained selectors.
Explore how Unity UI Toolkit emits events from sliders and pointer interactions, including on change handlers and lambda usage, and extract previous and new values, pointer position, and geometry.
Master event propagation in Unity UI by following trickle down, target, and bubble up phases. See yellow, orange, and blue demonstrate the flow from outer container to target.
This course is a deep dive into Unity's UI Toolkit. You will learn most of the components that make up UI Toolkit and be able to create complex UI Systems for your games or apps.
This course uses a mix of theory and practice. We will create dozens of little UI-Components and examples. Furthermore, we will have a course project on which we will practice what we learned in the particular chapters. Finally, we will bring it all together and create a fully functional UI-based game.
While this course is not explicitly covering Editor Scripting most of the content in the course will also apply to it.
Here are some of the topics that we will cover:
Understanding UXML and USS Files
Understand the basic building blocks of UI Toolkit. We will talk about the concept of a visual tree and why it's a good idea to separate structure, styling and behavior.
Layouts with FLEXBOX
UI Toolkit uses the Flexbox system which is also used in web technologies.
Templates
We will learn how we can reuse pieces of our layout with templates.
Events and Event Propagation
No UI System can function without events. UI Toolkit has its own Event-System with modern features like event-propagation which we can use to our advantage.
UQuery
Unity is still a game engine, so more often than not most of your work will be done through scripts. U need an efficient way to connect your scripts and your UI and manipulate certain elements of your UI. In order to do that you first need to find those elements. UQuery provides a comfortable way how you can do that.
Data Binding
While for editor scripting there is already a system in place which helps you bind your data to your components, this is not the case for runtime. Therefore we will look at some tools and techniques how you can do this manually.
Custom Components
UI Toolkit has a library of several build-in controls, but obviously, those can not cover every use case that you might come across. In this section, we will see how to create our own controls and thereby create our own little library of reusable UI Elements.
Manipulators
One rule of good software development is the separation of concerns. In this section, we will learn how we can group the behavior of particular elements into manipulators.
and much more...