IgnoreValidation()
Disables BaseField<TValueType>.onValidateValue until the returned scope is disposed.
Read time 1 minuteLast updated 5 hours ago
Definition
- Type: Method
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsControlsModule
public BaseField<TValueType>.IgnoreValidationScope IgnoreValidation()
Returns
Type | Description |
|---|---|
| IgnoreValidationScope | A scope that re-enables validation when disposed. |
Remarks
Scope this method with a statement and use it with the BaseField<TValueType>.value setter or BaseField<TValueType>.SetValueWithoutNotify to assign a value that bypasses validation. Only BaseField<TValueType>.value results in a ChangeEvent<T>. The scope can be nested safely.
usingThe following example sets a value that skips the field's validation: