I would like to bind a ScriptableObject’s sprite texture to a Unity UXML editor window. I feel like this should be easy to do (UXML images to objects should be common) and I’ve seen a Bind
method on the <ui:Image />
tag. But I can’t figure out how to setup a binding properly. How do I bind a UXML image to an Object’s sprite field?
I’ve noticed you can easily bind a <ui:Label>
label as so.
var title = _container.Q<Label>("item-entry__name");
title.text = definition.DisplayName;
title.bindingPath = "_displayName";
title.Bind(new SerializedObject(definition));
Here is the editor window I’m trying to bind.