- Validator: Added asset validators with material texture and shader validation

- Validator: Added option to enable/disable certain validators
- Project Settings: Fixed issue, where changes weren't always saved
- Unity: Removed deprecated warnings in Unity 6.4
This commit is contained in:
Anders Ejlersen 2026-05-24 18:06:56 +02:00
parent 01ac17a078
commit dd55a87740
30 changed files with 716 additions and 38 deletions

View file

@ -1,15 +1,50 @@
# Description
A tool to help validate data across scenes, prefabs and scriptable objects.
A tool to help validate data across scenes, prefabs, scriptable objects and assets.
![Editor Window](~Images/editor-window.png)
### Unity Windows
## Unity Windows
![Hierachy Window](~Images/editor-hierarchy-window.png)
![Project Window](~Images/editor-project-window.png)
## Game Object Validators
## Settings
![Project Settings](~Images/editor-project-settings.png)
## Validators
### Asset Validators
```csharp
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
```csharp
public sealed class GameObjectValidatorBrokenPrefab : IGameObjectValidator
@ -22,7 +57,7 @@ public sealed class GameObjectValidatorBrokenPrefab : IGameObjectValidator
}
```
## Component Validators
### Component Validators
```csharp
public sealed class ComponentValidatorMeshCollider : IComponentValidator<MeshCollider>
@ -35,7 +70,7 @@ public sealed class ComponentValidatorMeshCollider : IComponentValidator<MeshCol
}
```
## Attribute Validators
### Attribute Validators
The field attribute:
```csharp