using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; namespace Module.ProjectValidator.Editor { internal sealed class AssetValidatorMaterialTexture : IAssetValidator { public void Validate(Material obj, List 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")); } } } }