Ecosystem Hub Core Framework (156+) Animated (87) Component Designer (75) Hierarchy Designer (83) Validation Module (39) Inspector Customizer ToolBox Vol. 1 (4)

[ValidateNotNull]

Target: Field Severity: Error Engine Scanned

Validates that an object reference, string, or collection is not null or empty, displaying high-contrast alert banners directly in the Inspector and surfacing warnings in the Project Scanner.

Unity Inspector Simulated Preview • PlayerInventory.cs
Item Database
Item database asset must be assigned. Cannot proceed without item definitions.

1. Overview & Value Proposition

What it does: Eliminates null reference exceptions by asserting that field references are never left unassigned. It detects missing assets, empty strings, and zero-length arrays before you hit Play.

The Problem: Null references account for over 70% of runtime bugs in Unity projects. Standard Unity performs zero checks on unassigned fields in the inspector.

The Solution:

  • Deep Null & Empty Detection: Setting FailOnEmpty = true additionally catches empty string IDs and zero-element collections.
  • Direct Inspector Alerts: Renders high-contrast inline error cards.
  • 1-Click Project-Wide Scan: The Validation Module window discovers all unassigned fields across the entire project in 1 click.

2. Quick Start Example

using UnityEngine;
using MaharajaStudio.MSUltimate.ValidationModule;

public class PlayerInventory : MonoBehaviour
{
    [ValidateNotNull("Item database asset must be assigned.")]
    public ScriptableObject itemDatabase;

    [ValidateNotNull("Character display name cannot be null or empty.", FailOnEmpty = true)]
    public string characterName = "Hero";
}

[ValidateRange]

Target: Field Severity: Warning Numeric Guard

Enforces minimum and maximum numeric boundaries on serialized fields, warning when values exceed safe design ranges and preventing out-of-bounds calculations.

Unity Inspector Simulated Preview • WeaponController.cs
Fire Rate (Rounds/Sec)
Fire rate exceeds maximum safe simulation rate (Max: 60.0 rps).

1. Overview & Value Proposition

What it does: Guards numeric floats and integers against unrealistic or game-breaking values. Unlike basic Unity sliders which only cap UI dragging, [ValidateRange] also catches programmatic mutations, copy-pastes, and ScriptableObject overrides.

Validation Module Catalog (39 Total)

39 Validation Attributes & Scanner Staged

All 39 validation attributes and the project diagnostic window engine are staged inside assets/Documentations/MSUltimate/Addons/ValidationModule/Documentation/.