Attribute Checks

How the Check Works

The CheckAttributes check drives the validation of the verification Attributes – the attributes such as VRequired, VNotNull or VRange that you add to fields in your own scripts. When this check runs, it walks the serialized fields of your MonoBehaviours and ScriptableObjects (recursing into nested serializable objects), finds every field decorated with one of these attributes, and asks the attribute to validate the field’s current value.

In other words, this is the check that makes attributes like [VRequired] or [VStringCheck(...)] actually report problems during a scan. Without it enabled, the attributes on your fields would not be evaluated.

When to Use This Check

  • Enforce Your Own Rules: Validate that the components you wrote are set up correctly, using the attributes you placed on their fields.
  • Fine-Grained Control: Turn individual attributes on or off, and set a different severity (Error, Warning, or Info) for each one, so the check fits the needs of each profile.

Settings

Unlike most checks, this one exposes one entry per available attribute in its profile settings. Every attribute that implements the verification attribute interface is listed automatically, and for each you can:

  • Toggle it between Active and Not active.
  • Set its severity to Error, Warning, or Info.

New attributes are added to this list automatically with a default severity of Warning and turned on, so custom attributes you write will start being validated as soon as the profile picks them up.

How to fix errors like this

A finding from this check tells you that a field violates the rule expressed by its attribute – for example a [VRequired] field that is empty, or a [VRange] value that is out of range. Fix it by assigning a valid value to the field on the reported object. For the full list of available attributes and what each one validates, see the Attributes page.

Was this page helpful?