I’m trying to understand how to use the itemTemplate field on a ListView in UI Builder.
This is the UXML I’m trying to assign:
The TextField and ColorField’s bindingPaths are set to fields of the ScriptableObject.
The list correctly visualises and the template instantiates, but the fields are not bound and I get this in the console:
Field type UnityEngine.UIElements.TemplateContainer is not compatible with PPtr<$Persona> property "Personas.Array.data[0]"
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:219)
Persona is a ScriptableObject type that constitutes an element in the list.
I kinda understand the issue: the item in the source collection (the SO Persona) is being bound to the root of this VisualTreeAsset, and that creates the type mismatch.
But so what’s the correct workflow to use a VisualTreeAsset assigned in the UI Builder like so?