No description
Find a file
2026-05-27 19:24:07 +02:00
Editor Validator: Fixed issue, where scene wouldn't unload, if an exception is thrown 2026-05-27 19:24:07 +02:00
Runtime - Validator: Added asset validators with material texture and shader validation 2026-05-24 18:06:56 +02:00
~Images Fixed issue, where the validator enabled state couldn't be loaded correctly, if in another assembly 2026-05-24 23:09:47 +02:00
.gitignore Initial commit 2026-05-17 19:59:52 +00:00
Editor.meta Added initial version 0.1.0 2026-05-17 22:12:04 +02:00
LICENSE Initial commit 2026-05-17 19:59:52 +00:00
LICENSE.meta Added initial version 0.1.0 2026-05-17 22:12:04 +02:00
package.json Bumped version to 1.0.2 2026-05-26 18:05:54 +02:00
package.json.meta Added initial version 0.1.0 2026-05-17 22:12:04 +02:00
README.md - Validator: Added asset validators with material texture and shader validation 2026-05-24 18:06:56 +02:00
README.md.meta Added initial version 0.1.0 2026-05-17 22:12:04 +02:00
Runtime.meta Added initial version 0.1.0 2026-05-17 22:12:04 +02:00
~Images.meta Added documentation 2026-05-17 22:29:59 +02:00

Description

A tool to help validate data across scenes, prefabs, scriptable objects and assets.

Editor Window

Unity Windows

Hierachy Window Project Window

Settings

Project Settings

Validators

Asset Validators

public sealed class AssetValidatorMaterialTexture : IAssetValidator<Material>
{
    public void Validate(Material obj, List<ValidatorResult> results)
    {
        if (obj.shader == null)
            return;

        var count = obj.shader.GetPropertyCount();

        for (var i = 0; i < count; i++)
        {
            var propertyType = obj.shader.GetPropertyType(i);
            
            if (propertyType != ShaderPropertyType.Texture)
                continue;
            
            var propertyName = obj.shader.GetPropertyName(i);
            var propertyValue = obj.GetTexture(propertyName);
            
            if (propertyValue == null)
                results.Add(ValidatorResult.Create(EValidatorSeverity.Warning, $"Texture property '{propertyName}' is Null"));
        }
    }
}

Game Object Validators

public sealed class GameObjectValidatorBrokenPrefab : IGameObjectValidator
{
    public void Validate(GameObject gameObject, List<ValidatorResult> results)
    {
        if (PrefabUtility.IsPrefabAssetMissing(gameObject))
            results.Add(ValidatorResult.Create(EValidatorSeverity.Error, "GameObject is missing prefab asset"));
    }
}

Component Validators

public sealed class ComponentValidatorMeshCollider : IComponentValidator<MeshCollider>
{
    public void Validate(MeshCollider component, List<ValidatorResult> results)
    {
        if (component.sharedMesh == null)
            results.Add(ValidatorResult.Create(EValidatorSeverity.Error, "Missing mesh"));
    }
}

Attribute Validators

The field attribute:

[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
public sealed class RequiredAttribute : Attribute
{
    private readonly EValidatorSeverity _severity;

    public RequiredAttribute()
    {
        _severity = EValidatorSeverity.Error;
    }
    
    public RequiredAttribute(EValidatorSeverity severity)
    {
        _severity = severity;
    }
}

The validator implements IAttributeValidator<T>, where T is the attribute and will automatically be found by the validator.

public sealed class Validator : IAttributeValidator<RequiredAttribute>
{
    public ValidatorResult Validate(RequiredAttribute attribute, object value)
    {
        var isValid = value is UnityEngine.Object obj ? obj != null : value != null;
        return isValid ? ValidatorResult.Valid : ValidatorResult.Create(attribute._severity, "Value is Null");
    }
}