Creates an unbound field. Set UxmlAttributeField.bindingPath to bind it to a serialized property.
The field starts unbound. Set UxmlAttributeField.bindingPath to bind it, or use
UxmlAttributeField.UxmlAttributeField to bind it when you create it.
The following example creates an unbound field and sets <see cref="Unity.UIToolkit.Editor.UxmlAttributeField._bindingPath" /> to bind it.
var field = new UxmlAttributeField(); field.bindingPath = "text"; container.Add(field);
| Parameter | Description |
|---|---|
| property | The property to display and edit. Pass null to create an unbound field. |
Creates a field bound to the given serialized property.
When property is null, the field starts unbound. Set UxmlAttributeField.bindingPath
after you create it, or use the parameterless constructor.
The following example creates a field bound to a property from <c>FindPropertyRelative</c>.
var textProperty = property.FindPropertyRelative("text");
if (textProperty != null)
{
var field = new UxmlAttributeField(textProperty);
field.label = "Text Content";
container.Add(field);
}