Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UxmlAttributeField

Creates an unbound field. Set _bindingPath to bind it to a serialized property.
Read time 1 minuteLast updated 12 days ago

Definition

UxmlAttributeField()

Creates an unbound field. Set _bindingPath to bind it to a serialized property.
public UxmlAttributeField()

Remarks

The field starts unbound. Set _bindingPath to bind it, or use UxmlAttributeField to bind it when you create it.
The following example creates an unbound field and sets _bindingPath to bind it.

Examples

var field = new UxmlAttributeField();field.bindingPath = "text";container.Add(field);

UxmlAttributeField(SerializedProperty)

Creates a field bound to the given serialized property.
public UxmlAttributeField(SerializedProperty property)

Parameters

The property to display and edit. Pass null to create an unbound field.

Remarks

When
property
is null, the field starts unbound. Set _bindingPath after you create it, or use the parameterless constructor.
The following example creates a field bound to a property from
FindPropertyRelative
.

Examples

var textProperty = property.FindPropertyRelative("text");if (textProperty != null){ var field = new UxmlAttributeField(textProperty); field.label = "Text Content"; container.Add(field);}