I know that better binding of data to the UI is on the Unity roadmap so this might not be interesting to many people as it’s work that is coming but I’ve built a system to make it easy to bind data to the UI. I hook up the UI with code like this:
DataBinder.BindLabel("StrengthValue", "Strength");
DataBinder.BindLabel("IntelligenceValue", "Intelligence");
DataBinder.BindImage("Portrait", "CharacterImage");
DataBinder.BindStyle<bool>("Button", "display", "ShowButton", (value) => value ? DisplayStyle.Flex : DisplayStyle.None);
DataBinder.BindChildrenToContainer<Equipment>("Inventory", "Inventory", (item) => new InventorySlot(item));
So you can change the image of images, text of labels, children of scrollviews or other visualelements or the style of any element based on your game data. It also automatically updates the bindings when the values change using the INotifyProperty interface. So if you remove an item from the inventory in code the UI automatically updates etc.
You can either bind directly to a property or you can use a transform e.g. Button.style.display is set to Flex or None based on a bool property.
It’s made my code much more readable. If anyone is interested I’ll put it in a public github repo.