I look forward to a better UI system

I have been using Unity for 7 years, from NGUI to UGUI. I have used Unity2020’s UGUI to make a very complex UI system for commercial games. Most of the requirements can be achieved, but it is not so easy and comfortable.

Below I list some of the complex game UI requirements I have encountered:

  • The game needs to add particles, 2D graphics, and 3D objects to the UI panel, some before the image, some behind the image, some pre-placed in the prefab, and some are generated when the game is running.
  • All UI elements (including particles, 2D graphics, 3D objects) can be masked by the same mask component, the size and shape of the mask can be customized, and the mask can also be nested.
  • The button can be triggered without an image, and the size and shape of the trigger range can be customized.
  • The UI panel as a whole or partly supports disabling the trigger, changing the transparency, and superimposing some effects (blur, bloom, etc.).
  • Each UI panel can individually choose to use screen space or world space.
  • Support hot update, ensure the consistency of the scripting language, do not use another scripting language such as lua to achieve.
  • Support localization, users can choose synchronous or asynchronous two modes.
  • The text can be set with complex animation.
  • It is recommended to use a unique ID instead of a user-set name for scripts referencing UI elements to avoid problems caused by users modifying the names of UI elements later.

The Unity staff told me that the UI Toolkit will fulfill my needs in the future. After trying out the UI Toolkit of Unity 2021.2, I changed from expectation to doubt. Game UI and editing UI have their own unique needs, and it may be difficult for a UI system to meet both needs at the same time. A better choice may be to have a basic UI framework on which to develop two independent UI systems for games and editing, and even users can develop their own UI systems under the basic UI framework (refer to URP for games and HDRP for movies).

2 Likes

A lot of your points seem to be on their roadmap. I don’t know the timeline when they will be implemented though.

https://unity.com/roadmap/unity-platform/gameplay-ui-design

The roadmap looks good, but I can’t imagine it can be achieved very well under the existing framework.

1 Like

UI Toolkit doesn’t support any of these, and with the web-inspired direction they’re going, several of these will be very awkward to implement. The only game UI framework I know of that made these things easy was a certain discontinued Flash-based one made by Autodesk.

I’m really on the fence about Toolkit runtime right now. Just the other day, I wanted to make icons edges glow using a SDF. Without being able to use a custom shader, I ended up needing to create a separate render target, draw it there, and assign that to the background. That’s not performant nor is it easy to use.

Need to render some 3D objects in front of the panel? Render target. Want to blur the background behind the panel? Render target. Want some interesting text effects that aren’t exposed? UGUI+TextMeshPro and layering that on top of the UITK. Gradients? Generate the mesh vertices yourself.

You can do it all with render targets and/or manually generating the vertices, but that’s no longer using the UI framework for anything but layout. Heck, even focus/events I find easier to handle directly in some cases to make it feel natural with a controller (consider a grid of items; default focus completely fails there). So it’s mostly become a layout engine. Which is better than nothing, but not the UI framework I imagined when I started this project.

2 Likes

If UI Toolkit can also be used to make web pages in the future, that would be a great feature.

If you want to make webpages with CSS and flexbox, I have some good news for you :sunglasses:

I’d rather they focus on making a game/simulation UI framework.

1 Like