Initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace NaughtyAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public class MaxValueAttribute : ValidatorAttribute
|
||||
{
|
||||
public float MaxValue { get; private set; }
|
||||
|
||||
public MaxValueAttribute(float maxValue)
|
||||
{
|
||||
MaxValue = maxValue;
|
||||
}
|
||||
|
||||
public MaxValueAttribute(int maxValue)
|
||||
{
|
||||
MaxValue = maxValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a748250af5ccfd7499cfb444aafb8a03
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace NaughtyAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public class MinValueAttribute : ValidatorAttribute
|
||||
{
|
||||
public float MinValue { get; private set; }
|
||||
|
||||
public MinValueAttribute(float minValue)
|
||||
{
|
||||
MinValue = minValue;
|
||||
}
|
||||
|
||||
public MinValueAttribute(int minValue)
|
||||
{
|
||||
MinValue = minValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40133bac7c8d42b4d837138430a503e0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace NaughtyAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public class RequiredAttribute : ValidatorAttribute
|
||||
{
|
||||
public string Message { get; private set; }
|
||||
|
||||
public RequiredAttribute(string message = null)
|
||||
{
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b0cdf49d1687849458b1a8d4786553d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace NaughtyAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||
public class ValidateInputAttribute : ValidatorAttribute
|
||||
{
|
||||
public string CallbackName { get; private set; }
|
||||
public string Message { get; private set; }
|
||||
|
||||
public ValidateInputAttribute(string callbackName, string message = null)
|
||||
{
|
||||
CallbackName = callbackName;
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c4171d68fb5bc0448d3ac298973e82c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace NaughtyAttributes
|
||||
{
|
||||
public class ValidatorAttribute : Attribute, INaughtyAttribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f3c43bed2dbc5249b6c6ec7859c2020
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user