1
0
mirror of https://github.com/maxartz15/Validator.git synced 2025-06-25 19:16:06 +02:00

Required Attribute Validator

This commit is contained in:
max
2021-12-29 23:46:52 +01:00
parent 165afa3c53
commit 74fd067220
12 changed files with 145 additions and 7 deletions

8
Runtime/Validators.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8cd25e23ad137e24ea0f469556831712
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 25705f09a21a10049aed213ea301db84
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,19 @@
using System;
namespace Validator
{
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class RequiredAttribute : Attribute
{
public WarningType WarningType { get; private set; } = WarningType.Error;
public string Category { get; private set; } = ReportCategories.Design;
public RequiredAttribute() { }
public RequiredAttribute(WarningType warningType = WarningType.Error, string category = ReportCategories.Design)
{
WarningType = warningType;
Category = category;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4dbbb107f0e849140b1132ac5dcca90f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: