- 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

@ -0,0 +1,31 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
namespace Module.ProjectValidator.Editor
{
internal 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"));
}
}
}
}