Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add the new unity uxml(via ui builder) to game screen?

I installed the new Unity UI Builder. Everything works just fine...

But how do I add the uxml to my scene or how do I attache it to camera?

I tried to drag and drop the uxml to camera and I searched for a component, but I couldn't find anything... Is there any official documentation?


1 Answers

You must use an gameObject with PanelRenderer.cs attached to it: Panel renderer in order to use uxml in runtime

For now, I only know you have to set UXML file and USS file. In play mode, by magic (I still don't understand how unity does it), it will render.

In the Github project you can see how things are for now. UIElementsUniteCPH2019RuntimeDemo

EDIT: The project linked above uses UI Builder 0.8.

like image 171
Pablo Expósito Avatar answered Jan 21 '26 09:01

Pablo Expósito