Documentation

Unity Engine

Download Unity

Unity Engine

IgnoreValidation()

Disables BaseField<TValueType>.onValidateValue until the returned scope is disposed.
Read time 1 minuteLast updated 11 hours ago

Definition

public BaseField<TValueType>.IgnoreValidationScope IgnoreValidation()

Returns

Type

Description

IgnoreValidationScopeA scope that re-enables validation when disposed.

Remarks

Scope this method with a
using
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.
The following example sets a value that skips the field's validation: