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:
8
Runtime/Validators.meta
Normal file
8
Runtime/Validators.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cd25e23ad137e24ea0f469556831712
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Runtime/Validators/Attributes.meta
Normal file
8
Runtime/Validators/Attributes.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25705f09a21a10049aed213ea301db84
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
19
Runtime/Validators/Attributes/RequiredAttribute.cs
Normal file
19
Runtime/Validators/Attributes/RequiredAttribute.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
11
Runtime/Validators/Attributes/RequiredAttribute.cs.meta
Normal file
11
Runtime/Validators/Attributes/RequiredAttribute.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4dbbb107f0e849140b1132ac5dcca90f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user