Class PropertyField
A SerializedProperty wrapper VisualElement that, on Bind(), will generate the correct field elements with the correct bindingPaths.
Inherited Members
Namespace: UnityEditor.UIElements
Syntax
public class PropertyField : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IBindable
Constructors
PropertyField()
PropertyField constructor.
Declaration
public PropertyField()
Remarks
You will still have to call Bind() on the PropertyField afterwards.
PropertyField(SerializedProperty)
PropertyField constructor.
Declaration
public PropertyField(SerializedProperty property)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | property | Providing a SerializedProperty in the construct just sets the bindingPath. You will still have to call Bind() on the PropertyField afterwards. |
Remarks
You will still have to call Bind() on the PropertyField afterwards.
PropertyField(SerializedProperty, String)
PropertyField constructor.
Declaration
public PropertyField(SerializedProperty property, string label)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | property | Providing a SerializedProperty in the construct just sets the bindingPath. You will still have to call Bind() on the PropertyField afterwards. |
String | label | Optionally overwrite the property label. |
Remarks
You will still have to call Bind() on the PropertyField afterwards.
Fields
inputUssClassName
USS class name of input elements in elements of this type.
Declaration
public static readonly string inputUssClassName
Field Value
Type | Description |
---|---|
String |
labelUssClassName
USS class name of labels in elements of this type.
Declaration
public static readonly string labelUssClassName
Field Value
Type | Description |
---|---|
String |
ussClassName
USS class name of elements of this type.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
String |
Properties
binding
Binding object that will be updated.
Declaration
public IBinding binding { get; set; }
Property Value
Type | Description |
---|---|
IBinding |
Implements
bindingPath
Path of the target property to be bound.
Declaration
public string bindingPath { get; set; }
Property Value
Type | Description |
---|---|
String |
Implements
label
Optionally overwrite the label of the generate property field. If no label is provided the string will be taken from the SerializedProperty.
Declaration
public string label { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
ExecuteDefaultActionAtTarget(EventBase)
Declaration
protected override void ExecuteDefaultActionAtTarget(EventBase evt)
Parameters
Type | Name | Description |
---|---|---|
EventBase | evt |
Overrides
RegisterValueChangeCallback(EventCallback<SerializedPropertyChangeEvent>)
Registers this callback to receive SerializedPropertyChangeEvent when a value is changed.
Declaration
public void RegisterValueChangeCallback(EventCallback<SerializedPropertyChangeEvent> callback)
Parameters
Type | Name | Description |
---|---|---|
EventCallback<SerializedPropertyChangeEvent> | callback |