Styling and UI Builder unstable behaviour

Hi, I’m trying to understand UI toolkit for a few days now. And after many tests, it seams that the styles system is brokenwith UI Builder.
The steps to reproduce the bugs are simple :

  • Load a sample scene of UI Toolkit (I took ClickEvent sample scene)

  • Modify the Inline style of elements in UI Builder.

  • Save the UXML in UI Builder.

  • Then build (I tested Android and Windows and the result are the same)

  • And test. The inline style of elements will not apply, while the USS file will apply.

  • Open the UXML file in any text editor and edit it

  • Save it and come back in Unity

  • Build the app and test, and then the styling is correct.

While doing these tests, the Simulator/Game view in the editor reacted correctly, even when saving with UI Builder. It’s only on the build that the bug appear.

I’ll later try with UIDocument parenting to see if the behaviour is correct.

I hope, it can help you improving this wonderfull tool !

Hi DVBlue,

When you save the asset, are you using the menu item in the UI builder?

The ctrl-s shortcut save the scenes and not the UI. We are using a live reload in play mode as to reflect the change instantaneously in the game view, without any need for saving. If the changes to UXML are not saved, that could explain the situation you are describing.

Also, which version of the UI Builder are you using?

@SimonDufour : It’s nice to know that the shorcut don’t save in UI Builder ! I’ll try with the menu.
@uDamian : I use Unity 2020.1.8f1 and UI builder 1.0.0-preview.7 (and UI Toolkit 1.0.0-preview.9)

Actually I save my files in a text editor outside to be sure Unity take it into account. And it work well.

Please try the just-released UI Builder 1.0.0-preview.9. This issues was specifically addressed in the latest version so I’m hoping it fixes you’re scenario.