Examples
Now that we have the basic building blocks we need to get started with actually creating some UI with UI Toolkit. I didn’t dive deep into style sheets or the properties of the various Visual Elements, but I’ll show some examples that will expand upon that here. If after completing these examples, you want to learn more, see the Resources section for a bunch of examples and documentation.
When using the UI Toolkit to develop UI, there are two main parts to the work:
- Laying out the UI with the UI Builder (or by editing the UXML document)
- Writing C# code to add functionality to the UI
So, each of these examples will be broken into two parts: one for building the UI and the other for writing the functionality.
Because the UI Toolkit can be used for both Editor and runtime UI, I’ll show you one example of both. Let’s start with the Editor example!
Using the UI Toolkit to make an Editor virtual pet
While the primary focus...