UI Toolkit 1.0-preview available

Hi everyone,

We’re excited to share the first version of the new UI Toolkit package, expanding on the existing VisualElement tech stack (formerly UIElements) to include visual authoring workflows and runtime support.

If you’re interested in trying it, read on!

What’s new?
Let’s start with the name. UI Toolkit was formerly known as UIElements . This marks the beginning of the transition to the new name.

UI Toolkit can now be distributed as a package, which makes it more convenient to get access to the latest preview releases. More on that below.

It’s now possible to use UI Toolkit for creating game and application UI.

Finally, the UI Builder, which will remain a separate package, has received a lot of stability and user experience improvements.

What’s the plan?
As of right now, we’re developing UI Toolkit as a package. That means we can develop features faster, and easily give interested users early access.

The plan is for every Unity release to ship with a stable version of the package fully integrated as a core feature. We’ll make a preview version available that you can install seamlessly to access experimental features.

In this first release, for the 2020 release cycle, the built-in UIToolkit includes the VisualElement tech stack, while the preview package includes new runtime UI features.

For more information about how UI Toolkit in core compares to the package, see this page.

This is the first of many versions of the preview package that we’ll be releasing throughout the year. In the upcoming months, we’ll be improving workflows, performance, and documentation, with the goal of shipping a pre-release version for 2020.2 by end of year.

In 2021.1, the UI Toolkit that ships with Unity will be considered production-ready. We’ll continue to make the preview package available to give you early access to features in development.

What will be included?
The version shipping in 2021.1 is aimed at programmers and UI artists collaborating on mobile and desktop games UI. Here’s a non-exhaustive list of the included features:

  • Scene Components required to display UI in the Unity player

  • Screen space UI

  • Menus, HUDs and screen space elements following game objects, such as health bars

  • Mobile friendly controls

  • Custom UI Themes

  • Improved text features and workflow coming from TextMesh Pro

  • Signed Distance Field (SDF) text rendering

  • Fully support Fonts fallback

  • UI texture atlas

  • New UI Toolkit dynamic atlas

  • Support for the existing Sprite Atlas

  • Dedicated tools for authoring and debugging UI

  • Compatibility with the Scriptable Render Pipeline (both URP and HDRP)

  • Compatibility with the new Input System

What’s coming in the next release?
Here’s what we’re currently working on and should be available to try in the upcoming UI Toolkit 1.0 preview releases:

  • First version of text workflow, including some text effects
  • Dynamic atlasing parameters exposed
  • Live update of doing changes in the UI Builder while in Play mode
  • New Input System support and associated use cases

What will ship later?
Here are the features that are still in development and which are planned to be in preview in a future UI Toolkit 1.1 release:

  • UI Animation
  • Data binding for runtime
  • Custom shaders
  • 3D lit UI and world space UI

How to get started?
Follow these steps to get started using UI Toolkit:

  • Install the latest Unity 2020.1 or 2020.2 version

  • 2020.1.9f1 or 2020.2.0b9 respectively

  • Install the com.unity.ui package, this is required to use the UI Toolkit at runtime

  • Can be installed via the Package Manager by selecting Add package from git URL and entering com.unity.ui in the input field.

  • :warning: an ongoing issue may force you to re-import your project after adding or upgrading UI Toolkit.

  • Install the com.unity.ui.builder package, this is required to use the visual authoring tool

  • Can be installed via the Package Manager after enabling Preview packages via Project Settings.

  • Consult the documentation to learn how to add UI into your project

Take a look at an example of UI Toolkit integration in a sample project.

How can you help?
In the upcoming months, we’ll be improving UI Toolkit based on your experience using it. We’re counting on you to try it out and share your feedback with us. We’ll post dedicated forum threads to request feedback on specific features or areas but generally, we’re curious to learn more about workflows, performance and bugs you’re running into.

We’re looking forward to hearing from you!

Cheers,

24 Likes

So, instead of "com.unity.ui.runtime": "0.0.4-preview" hidden package, it’s now “com.unity.ui”: “1.0.0-preview.3”?
Or those are not related? If they are, what changed besides “officializing” into a ‘not-hidden’ package?

The com.unity.ui.runtime package is the early experiment we released last year, before doing the work of moving into a package. The com.unity.ui package contains a few improvements over the old one, and is the version we will improve, maintain and support over time.

1 Like

Is it possible to use (even an old version) of UI Toolkit in 2019.4.3f1 for rendering in game? I installed UI Builder tonight and am really enjoying it but can’t figure out how to do this, probably I’m just being dumb. In the Unite 2019 demo I can see a Panel Renderer component was used, but I don’t seem to have that.

The new “com.unity.ui” package will only work with 2020.1 and newer. Not with 2019.4. You can try to get something working for runtime using the aforementioned “com.unity.ui.runtime”: “0.0.4-preview” (that adds the Panel Renderer component), but that approach will not be supported and you’ll have to switch over to “com.unity.ui” once you move to 2020.1+.

2 Likes

On Unity 2020.2.0a12.1591 I am getting the following errors:

Library\PackageCache\com.unity.ui@1.0.0-preview.3\Core\UIElementsRuntimeUtility.cs(142,44): error CS0117: 'UIElementsRuntimeUtilityNative' does not contain a definition for 'UpdateRuntimePanelsCallback'

Library\PackageCache\com.unity.ui@1.0.0-preview.3\Core\UIElementsRuntimeUtility.cs(150,44): error CS0117: 'UIElementsRuntimeUtilityNative' does not contain a definition for 'UpdateRuntimePanelsCallback'

Thank you! I can’t seem to find it in package manager (including preview packages). I’ll just jump up to 2020.1 beta, worth it! By the way, loving it so far! Really intuitive (for me at least, have a fair bit of web dev experience), and just generally awesome. I’m able to build UIs faster and better than stuff I spent much longer on in the current system. Super exciting!

By the way, is there a way to outline to text? Like, outlining the text itself, each character, not the rectangular text object.

I hate to say it but after upgrading to Unity 2020 beta, I still can’t find the UI Toolkit package in package manager. I no longer see an option for including preview packages, is this option not available (and presumably default to on) in beta builds?




1 Like

You need to open the manifest.json file in your Unity project and add “com.unity.ui”: “1.0.0-preview.3”

3 Likes

Thank you, I’ve got it installed now. Very excited to dive in.

Hmm, could I ask for advice from experienced Unity people: I’m a couple months into seriously (but as a non-professional) learning C# and Unity. I’ve worked with the current UI on a practice game with my partner already.

Is this system ready enough that I should just focus on learning it instead? We’re almost ready to start our next real game, a color puzzle game targeting touchscreen Windows as well as mobile devices (because we’re masochists I guess).

Text effects will be available in the next update.

4 Likes

For inexperienced devs making their first game, I personally always recommend going with the older systems first since your primary objective should be learning which boils down to gaining more general experience with the engine and widening your “vocabulary” of terms and ideas that you pick up as you use the existing unity systems. You’ll progress much faster with UGUI thanks to the wealth of learning resources, existing open source code you can use and asset store assets made on the current UI system to help you out with animations, particle effects, performance and anything else you need to know for your game.

3 Likes

What’s the ETA of adding DOTS support?

1 Like

Still work in progress, aiming to have a preview version we can share by end of year.

6 Likes

Will other types of elements be added to the runtime. It does not seem that the ProgressBar is available for runtime.
This type of component could be usefull for scene loading screen of even healtbar.
Also if I may ask, the tank demo first shown with the previous package showcased the tank healthbar as worldspace circular progress bar on each tanks if I’m not mistaken.

From the new demo I can already see that we could manage billboarded worldwpace ui.
Are there plan to :
1 ) include the progress bar as a runtime ui element ?
2 ) allow for different shape of progress bar (linear and circular) ?
3 ) “real” worldspace ui (like the tank demo health bar), were the UI can be rendered and masked by 3d object (wichi is not the case with the unity royale demo)

Does UI toolkit support rendering massive amount of health bar UIs following each unit use case with high performance?

2 Likes

Yes, and other ones as well. We will continue to expand the library of controls available at runtime.

No plans yet but we’re tracking the request

We’re aiming at releasing world space UI next year

2 Likes

The UI renderer should be able to handle it if they are all sharing the same underlying UI panel. We’ll add this case in our testing scenarios.

11 Likes

I did a quick dirty (and ugly) test by cloning the Gameobject that does the rendering of my ability cooldown.
Diplicating it 100 times does seem to have an big impact on preformance as the Panel.Update function take 20+ms wehn it take 0.6 ms with only one of them.
As you can see beloow when not updating ui data (phase of casting the ability that is not represented in UI) there is no spike.

Now to be fair i think the spike are because 1 ) I duplicate the UIDocument (so I probably have 100 panel) 2 ) All update happen at the exact same frame (same underlaying ability) so in case of health bar they probably won’t be updated at the same time although updating their position in world space ma impact that asesment…

6071742--658380--upload_2020-7-9_15-30-19.jpg

1 Like