Dragon Crashers - UI Toolkit Sample project

UI Toolkit Sample – Dragon Crashers was developed by Unity to showcase some of the workflows included in the e-book User interface design and implementation in Unity. The e-book explains how to use UI features in Unity, mainly the UI Toolkit, to create user interfaces.


This demo uses UI Toolkit with UXML and USS files to recreate common game interface layouts and styles, showing both simple and more advanced use cases. The naming convention and structure of the demo can also be used as a reference for creators starting projects with UI Toolkit.


Actions illustrated in the demo include how to:

  • Style with selectors in USS files and use UXML templates
  • Create custom controls such as a circular progress bar or tabbed views
  • Customize the appearance of elements such as sliders or toggle buttons
  • Use Render Texture effects for UI overlay effects
  • Apply USS animations, seasonal themes, and more
  • Handle different screen ratios, particularly, changes of UI styling at runtime between portrait and landscape mobile screen orientations
  • Use the SafeArea API to contain UI functionality within the usable screen area of your device
  • Follow design patterns for clean UI architecture to ensure scalability and maintainability.
  • Bind data to the UI using UI Toolkit's databinding
  • Includes Localization, you can see examples of localization tables for strings and images, you can change the language from the settings menu

All of the content in this demo can be added into your own Unity projects.

To try the demo after adding it to your assets, enter Play mode. Please note that UI Toolkit interfaces don’t show in the Scene view. Instead, see the interface in the Game view or UI Builder.


Note: When you open UI Builder, make sure you select the right theme so the elements in UI Builder match how they appear in the Game view. Themes are selectable in the ViewPort menu, next to the Preview button


This demo has been tested on popular desktops and across common iOS and Android devices. It’s made in Unity 6 and uses the 2D Renderer in the Universal Render Pipeline (URP).


If you’re interested in the 2D graphics and gameplay in the UI Toolkit sample, check out the e-book 2D game art, animation, and lighting for artists.


Distributed under the Unity Companion License (“License”). Unity Technologies ApS (“Unity”) grants to you a worldwide, non-exclusive, no-charge, and royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute the software that accompanies this License, subject to the following restrictions, terms, and conditions. Link

Release Notes

- Moved some of the Data binding in C# to uxml / UI BUilder

------------


Unity 6 update

  • Refactored some code to comply with UI Toolkit changes in Unity 6
  • Introduced some Unity 6 specific features. More to be expected soon with companion content
  • New welcome screen and Asset Store images
  • Smaller tweaks for Unity 6
  • Using Data Binding to display data on the UI
  • Integrated Localization package, the sample includes localization tables for strings and images, it also uses binding features in UI Builder. Includes EN, DA, ES, FR

------------


22 LTS update

  • Refactored, simplified selectors and USS stylesheets
  • Higher resolution icons
  • Fixed VFX spawning position for different screen ratios and some cursor inconsistencies
  • Support for runtime landscape and portrait screen modes through themes and the GeometryChangedEvent in UI Toolkit
  • Usage of the SafeArea API to contain UI functionality within the usable screen area of your device
  • Refactored design patterns for cleaner UI architecture
  • Demo now runs at 60 fps on mobile devices
  • New learning content linked to from the Tutorial Inspector window

------------

  • Updated 2D Feature Set package

------------

  • Initial release

Basic Information
Latest Version
1.692 (09 Dec 2024)
Publisher
Unity Technologies
Category
Essentials/Tutorial Projects
Size
259.6 MB
Price
free
Asset Rating
(34)
Extended Information
Unity Versions
2021.3.7, 2022.3.11, 6000.0.24
Render Pipelines
URP
State
Published