I have a custom VisualElement that displays some values. These values are pulled from a singleton that stores some globally accessible information. The values can change as the game runs.
I can get the initial values in the singleton from within the VisualElement’s constructor. But, VisualElements do not contain an Update method. So I don’t have an easy way to check if any of the values have changed. What is the correct way to update the visual element when the values change?
I’m sorry if this is a stupid question. I’m new to UI Toolkit and I could not find any answers in the Documentation or by Googling. Maybe I just missed something.
We’ll be releasing data binding very soon that’s going to do exactly that. wait for announcements. Meanwhile, you can create your own update method using UITK schedulers, look it up in the docs. you basically create a scheduler that can call a method looped and start at any given time.