ValidatorAttribute Class

Summary

[Pro-Only] Base class for attributes that apply some sort of validation to a field.
graph BT Type-->Base0["PropertyAttribute"] Type["ValidatorAttribute"] class Type type-node Derived0["MaxValueAttribute"]-->Type click Derived0 "/inspector-gadgets/api/InspectorGadgets.Attributes/MaxValueAttribute" Derived1["MinValueAttribute"]-->Type click Derived1 "/inspector-gadgets/api/InspectorGadgets.Attributes/MinValueAttribute" Derived2["ClampValueAttribute"]-->Type click Derived2 "/inspector-gadgets/api/InspectorGadgets.Attributes/ClampValueAttribute" Derived3["HasComponentAttribute"]-->Type click Derived3 "/inspector-gadgets/api/InspectorGadgets.Attributes/HasComponentAttribute"

Syntax

[System.Diagnostics.Conditional("UNITY_EDITOR")]
public abstract class ValidatorAttribute : PropertyAttribute

Attributes

Type Description
ConditionalAttribute

Methods

Name Value Summary
TryValidate(double) bool
Validates a double value or returns false to revert to the previous value.
TryValidate(long) bool
Validates a long value or returns false to revert to the previous value.
TryValidate(Object) bool
Validates an UnityEngine.Object value or returns false to revert to the previous value.