Validatox
Custom Validators
Custom Validators
  • Custom validators
Powered by GitBook
On this page
  • Validation Group
  • Creating a custom Validator

Custom validators

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

Last updated 2 years ago

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.

Since by default all validators uses the custom implemented editor, in order to expose your variables inside the editor, create a new custom editor for your validator and inherit from the base class ValidatorCustomEditor. More info at:

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.

To understand how to develop validation fixes for you own purpose, check out .

Editor Scripting
Custom fix