Updated readme
This commit is contained in:
parent
5f108eee50
commit
c8a6815316
1 changed files with 4 additions and 4 deletions
|
|
@ -11,7 +11,7 @@ A tool to help validate data across scenes, prefabs and scriptable objects.
|
||||||
|
|
||||||
## Component Validators
|
## Component Validators
|
||||||
|
|
||||||
```c#
|
```csharp
|
||||||
public sealed class ComponentValidatorMeshCollider : IComponentValidator<MeshCollider>
|
public sealed class ComponentValidatorMeshCollider : IComponentValidator<MeshCollider>
|
||||||
{
|
{
|
||||||
public void Validate(MeshCollider component, List<ValidatorResult> results)
|
public void Validate(MeshCollider component, List<ValidatorResult> results)
|
||||||
|
|
@ -24,8 +24,8 @@ public sealed class ComponentValidatorMeshCollider : IComponentValidator<MeshCol
|
||||||
|
|
||||||
## Attribute Validators
|
## Attribute Validators
|
||||||
|
|
||||||
The field attrribute:
|
The field attribute:
|
||||||
```c#
|
```csharp
|
||||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
|
||||||
public sealed class RequiredAttribute : Attribute
|
public sealed class RequiredAttribute : Attribute
|
||||||
{
|
{
|
||||||
|
|
@ -45,7 +45,7 @@ public sealed class RequiredAttribute : Attribute
|
||||||
|
|
||||||
The validator implements `IAttributeValidator<T>`, where `T` is the attribute and will automatically be found by the validator.
|
The validator implements `IAttributeValidator<T>`, where `T` is the attribute and will automatically be found by the validator.
|
||||||
|
|
||||||
```c#
|
```csharp
|
||||||
public sealed class Validator : IAttributeValidator<RequiredAttribute>
|
public sealed class Validator : IAttributeValidator<RequiredAttribute>
|
||||||
{
|
{
|
||||||
public ValidatorResult Validate(RequiredAttribute attribute, object value)
|
public ValidatorResult Validate(RequiredAttribute attribute, object value)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue