Property Validator
- Create new folder and name it
Editor. -
Inside
Editorfolder create new class,ExampleValidator.cspublic class ExampleValidator { } -
Inherit from
PropertyValidatorclass.public class ExampleValidator : PropertyValidator { } -
Implement abstract method
Validate.public class ExampleValidator : PropertyValidator { public override void Validate(SerializedProperty property) { // Property validation here... } } -
Add
ValidatorTargetattribute and setExampleAttributeas target to this view.[ValidatorTarget(typeof(ExampleAttribute))] public class ExampleValidator : PropertyValidator { public override void Validate(SerializedProperty property) { // Property validation here... } }