Added component validators
This commit is contained in:
parent
35f271e12b
commit
d7145ad772
30 changed files with 448 additions and 200 deletions
|
|
@ -0,0 +1,19 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Module.ProjectValidator.Editor
|
||||
{
|
||||
internal sealed class ComponentValidatorMeshRenderer : IComponentValidator<MeshRenderer>
|
||||
{
|
||||
public void Validate(MeshRenderer component, List<ValidatorResult> results)
|
||||
{
|
||||
var materials = component.sharedMaterials;
|
||||
|
||||
for (var i = 0; i < materials.Length; i++)
|
||||
{
|
||||
if (materials[i] == null)
|
||||
results.Add(ValidatorResult.Create(EValidatorSeverity.Error, $"Missing material in slot #{i}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue