How do you use new UIToolkit Binding system?

Hi there !

I am facing the exact same case and using the unitypackage provided by @Onigiri with the fix for the data-source-path. For me nothing is linked, updating the data does not refresh the UI and changing the field does not change the data.

I am using unity 2023.2.0a22, I have the exacte same problem with unity 2023.2.0b4.

Do you have any clue on why this does not work ?

I tried it again and it works for me. The bindings work in play mode.

And if I tag the UITest class with [ExecuteAlways], it also binds outside of play mode.

Is there any errors while importing the package?

Ok to exclude any issue on my side I tried the unitypackage in a new project with data-source-path fixed, and it worked, the only difference I had was that the [SerializeField] private float _foo was below the start function. Putting it on top magically made it work.
Trying to reproduce this on the test project worked normally so I rolled back and put my field in original position, and it still worked.
Looks like a refresh issue with domain reload or something
Thanks for answering :wink:

1 Like

Hello, just started to explore the bindings and I’m experiencing the same problem as SebMaire. I’ve made a project from 3D template in 2023.2.0b9 and recreated the files as per example above. Strung it together, hit play and nothing. I was able to reproduce the example from the binding documentation that creates bindings from code. No errors, no warnings, just not being bound or updated. I’m attaching the project (it’s completely bare bones).

Alright, my bad. I copied the wrong snippet. The problem was the mentioned dataSourcePath instead of data-source-path in uxml. After reading that the example was updated, I haven’t even think to check it, but there are two version of it and only one is correct :slight_smile:

9362459–1309301–UIToolkitBinding.zip (93 KB)

Hi @Knedlo , from what I could see in your sample, it should be the same resolution as described here .

Hope this helps!