BaseField<TValueType>
Abstract base class for controls. A BaseField is a base class for field elements like TextField and IntegerField. To align a BaseField element automatically with other fields in an Inspector window, use the.unity-base-field__aligned USS class. This style class is designed for use with Inspector
Read time 10 minutesLast updated a day ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: AbstractBaseField
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<T>
[UxmlElement]public abstract class BaseField<TValueType> : AbstractBaseField, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle, IBindable, IMixedValueSupport, INotifyValueChanged<TValueType>
Static Fields
Value | Description |
|---|---|
| alignedFieldUssClassName | USS class name of elements that are aligned in a inspector element |
| inputUssClassName | USS class name of input elements in elements of this type. |
| labelDraggerVariantUssClassName | USS class name of labels in elements of this type, when there is a dragger attached on them. |
| labelUssClassName | USS class name of labels in elements of this type. |
| mixedValueLabelUssClassName | USS class name of elements that show mixed values |
| noLabelVariantUssClassName | USS class name of elements of this type, when there is no label. |
| ussClassName | USS class name of elements of this type. |
Constructors
Constructor | Description |
|---|---|
| BaseField`1(System.String,UnityEngine.UIElements.VisualElement) | Initializes and returns an instance of BaseField<TValueType>. |
Properties
Methods
Method | Description |
|---|---|
| IgnoreValidation | Disables BaseField<TValueType>.onValidateValue until the returned scope is disposed. |
| SetValueWithoutNotify | Allow to set a value without being notified of the change, if any. |
Events
Member | Description |
|---|---|
| onValidateValue | An event raised to validate or adjust the field's value before committing it. |
Structs
Struct | Description |
|---|---|
| BaseField<TValueType>.IgnoreValidationScope | A scope, returned by BaseField<TValueType>.IgnoreValidation(), that disables BaseField<TValueType>.onValidateValue until it is disposed. |
Delegates
Delegate | Description |
|---|---|
| BaseField<TValueType>.ValidateValueHandler | Represents a method that validates or adjusts a field's value before committing it. |