- 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:
parent
01ac17a078
commit
dd55a87740
30 changed files with 716 additions and 38 deletions
45
README.md
45
README.md
|
|
@ -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.
|
||||
|
||||

|
||||
|
||||
### Unity Windows
|
||||
## Unity Windows
|
||||
|
||||

|
||||

|
||||
|
||||
## Game Object Validators
|
||||
## Settings
|
||||

|
||||
|
||||
|
||||
## 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue