Custom validators

Learn how to create custom validators in order to implement adaptive validation functionalities

Validation Group

Validators can be grouped. This implies that validating the group will validate all the validators that belongs to that group. This can be useful to group different validation logics in different groups, so that they can be validated indipendently.

In order to create a new group: Create -> Validatox -> Validation group

Creating a custom Validator

Creating a custom validator is very easy. Simply inherit from the class Validatox.Validator and implement the abstract required methods.

In the end, mark the class with the Unity attribute CreateAssetMenu in order to be able to create the custom validator inside the Editor. At this point, the validator will have its own custom inspector with functionalities such as validation controls and info already available.

Validation fixes

Validatox now supports also validation fixes directly from the editor. Validation fixes can be thought as small popup windows that open when a user clicks on the relative fix button of the validation failure entry on the validation inspector.

The GuardValidator comes already with an implemented fix.

Multiple fixes are already implemented and ready to use. To check them out, import the namespace Validatox.Editor.Validators.Fix.

Last updated