UxmlAttributeField
Creates an unbound field. Set UxmlAttributeField.bindingPath to bind it to a serialized property.
読み終わるまでの所要時間 1 分最終更新 2ヶ月前
Definition
- Type: Constructor
- Namespace: Unity.UIToolkit.Editor
- Assembly: UnityEditor
UxmlAttributeField()
Creates an unbound field. Set UxmlAttributeField.bindingPath to bind it to a serialized property.
public UxmlAttributeField()
Remarks
The field starts unbound. Set UxmlAttributeField.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 is null, the field starts unbound. Set UxmlAttributeField.bindingPath after you create it, or use the parameterless constructor.
propertyThe following example creates a field bound to a property from .
FindPropertyRelativeExamples
var textProperty = property.FindPropertyRelative("text");if (textProperty != null){ var field = new UxmlAttributeField(textProperty); field.label = "Text Content"; container.Add(field);}