first commit

This commit is contained in:
Stefano Rossi 2025-07-12 18:59:18 +02:00
commit aa44d3ad70
Signed by: chadmin
GPG key ID: 9EFA2130646BC893
1585 changed files with 277994 additions and 0 deletions

View file

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 1f67e408a6d0adf4ab29d095ccd8b116
folderAsset: yes
timeCreated: 1507998942
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class AllowNestingAttribute : DrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,24 @@
using System;
using UnityEngine;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class AnimatorParamAttribute : DrawerAttribute
{
public string AnimatorName { get; private set; }
public AnimatorControllerParameterType? AnimatorParamType { get; private set; }
public AnimatorParamAttribute(string animatorName)
{
AnimatorName = animatorName;
AnimatorParamType = null;
}
public AnimatorParamAttribute(string animatorName, AnimatorControllerParameterType animatorParamType)
{
AnimatorName = animatorName;
AnimatorParamType = animatorParamType;
}
}
}

View file

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

View file

@ -0,0 +1,30 @@
using System;
using UnityEngine;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class CurveRangeAttribute : DrawerAttribute
{
public Vector2 Min { get; private set; }
public Vector2 Max { get; private set; }
public EColor Color { get; private set; }
public CurveRangeAttribute(Vector2 min, Vector2 max, EColor color = EColor.Clear)
{
Min = min;
Max = max;
Color = color;
}
public CurveRangeAttribute(EColor color)
: this(Vector2.zero, Vector2.one, color)
{
}
public CurveRangeAttribute(float minX, float minY, float maxX, float maxY, EColor color = EColor.Clear)
: this(new Vector2(minX, minY), new Vector2(maxX, maxY), color)
{
}
}
}

View file

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

View file

@ -0,0 +1,11 @@
using UnityEngine;
namespace NaughtyAttributes
{
/// <summary>
/// Base class for all drawer attributes
/// </summary>
public class DrawerAttribute : PropertyAttribute, INaughtyAttribute
{
}
}

View file

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

View file

@ -0,0 +1,57 @@
using System.Collections;
using System;
using System.Collections.Generic;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class DropdownAttribute : DrawerAttribute
{
public string ValuesName { get; private set; }
public DropdownAttribute(string valuesName)
{
ValuesName = valuesName;
}
}
public interface IDropdownList : IEnumerable<KeyValuePair<string, object>>
{
}
public class DropdownList<T> : IDropdownList
{
private List<KeyValuePair<string, object>> _values;
public DropdownList()
{
_values = new List<KeyValuePair<string, object>>();
}
public void Add(string displayName, T value)
{
_values.Add(new KeyValuePair<string, object>(displayName, value));
}
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
return _values.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public static explicit operator DropdownList<object>(DropdownList<T> target)
{
DropdownList<object> result = new DropdownList<object>();
foreach (var kvp in target)
{
result.Add(kvp.Key, kvp.Value);
}
return result;
}
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class EnumFlagsAttribute : DrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ExpandableAttribute : DrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,20 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = true, Inherited = true)]
public class HorizontalLineAttribute : DrawerAttribute
{
public const float DefaultHeight = 2.0f;
public const EColor DefaultColor = EColor.Gray;
public float Height { get; private set; }
public EColor Color { get; private set; }
public HorizontalLineAttribute(float height = DefaultHeight, EColor color = DefaultColor)
{
Height = height;
Color = color;
}
}
}

View file

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

View file

@ -0,0 +1,24 @@
using System;
namespace NaughtyAttributes
{
public enum EInfoBoxType
{
Normal,
Warning,
Error
}
[AttributeUsage(AttributeTargets.Field, AllowMultiple = true, Inherited = true)]
public class InfoBoxAttribute : DrawerAttribute
{
public string Text { get; private set; }
public EInfoBoxType Type { get; private set; }
public InfoBoxAttribute(string text, EInfoBoxType type = EInfoBoxType.Normal)
{
Text = text;
Type = type;
}
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class InputAxisAttribute : DrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class LayerAttribute : DrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,17 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class MinMaxSliderAttribute : DrawerAttribute
{
public float MinValue { get; private set; }
public float MaxValue { get; private set; }
public MinMaxSliderAttribute(float minValue, float maxValue)
{
MinValue = minValue;
MaxValue = maxValue;
}
}
}

View file

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

View file

@ -0,0 +1,37 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ProgressBarAttribute : DrawerAttribute
{
public string Name { get; private set; }
public float MaxValue { get; set; }
public string MaxValueName { get; private set; }
public EColor Color { get; private set; }
public ProgressBarAttribute(string name, float maxValue, EColor color = EColor.Blue)
{
Name = name;
MaxValue = maxValue;
Color = color;
}
public ProgressBarAttribute(string name, string maxValueName, EColor color = EColor.Blue)
{
Name = name;
MaxValueName = maxValueName;
Color = color;
}
public ProgressBarAttribute(float maxValue, EColor color = EColor.Blue)
: this("", maxValue, color)
{
}
public ProgressBarAttribute(string maxValueName, EColor color = EColor.Blue)
: this("", maxValueName, color)
{
}
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ResizableTextAreaAttribute : DrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class SceneAttribute : DrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,20 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ShowAssetPreviewAttribute : DrawerAttribute
{
public const int DefaultWidth = 64;
public const int DefaultHeight = 64;
public int Width { get; private set; }
public int Height { get; private set; }
public ShowAssetPreviewAttribute(int width = DefaultWidth, int height = DefaultHeight)
{
Width = width;
Height = height;
}
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class SortingLayerAttribute : DrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class TagAttribute : DrawerAttribute
{
}
}

View file

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

View file

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

View file

@ -0,0 +1,33 @@
using System;
namespace NaughtyAttributes
{
public enum EButtonEnableMode
{
/// <summary>
/// Button should be active always
/// </summary>
Always,
/// <summary>
/// Button should be active only in editor
/// </summary>
Editor,
/// <summary>
/// Button should be active only in playmode
/// </summary>
Playmode
}
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class ButtonAttribute : SpecialCaseDrawerAttribute
{
public string Text { get; private set; }
public EButtonEnableMode SelectedEnableMode { get; private set; }
public ButtonAttribute(string text = null, EButtonEnableMode enabledMode = EButtonEnableMode.Always)
{
this.Text = text;
this.SelectedEnableMode = enabledMode;
}
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ReorderableListAttribute : SpecialCaseDrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class ShowNativePropertyAttribute : SpecialCaseDrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,9 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ShowNonSerializedFieldAttribute : SpecialCaseDrawerAttribute
{
}
}

View file

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

View file

@ -0,0 +1,8 @@
using System;
namespace NaughtyAttributes
{
public class SpecialCaseDrawerAttribute : Attribute, INaughtyAttribute
{
}
}

View file

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

View file

@ -0,0 +1,8 @@
using System;
namespace NaughtyAttributes
{
public interface INaughtyAttribute
{
}
}

View file

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

View file

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

View file

@ -0,0 +1,15 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class BoxGroupAttribute : MetaAttribute, IGroupAttribute
{
public string Name { get; private set; }
public BoxGroupAttribute(string name = "")
{
Name = name;
}
}
}

View file

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

View file

@ -0,0 +1,26 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class DisableIfAttribute : EnableIfAttributeBase
{
public DisableIfAttribute(string condition)
: base(condition)
{
Inverted = true;
}
public DisableIfAttribute(EConditionOperator conditionOperator, params string[] conditions)
: base(conditionOperator, conditions)
{
Inverted = true;
}
public DisableIfAttribute(string enumName, object enumValue)
: base(enumName, enumValue as Enum)
{
Inverted = true;
}
}
}

View file

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

View file

@ -0,0 +1,26 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class EnableIfAttribute : EnableIfAttributeBase
{
public EnableIfAttribute(string condition)
: base(condition)
{
Inverted = false;
}
public EnableIfAttribute(EConditionOperator conditionOperator, params string[] conditions)
: base(conditionOperator, conditions)
{
Inverted = false;
}
public EnableIfAttribute(string enumName, object enumValue)
: base(enumName, enumValue as Enum)
{
Inverted = false;
}
}
}

View file

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

View file

@ -0,0 +1,39 @@
using System;
namespace NaughtyAttributes
{
public abstract class EnableIfAttributeBase : MetaAttribute
{
public string[] Conditions { get; private set; }
public EConditionOperator ConditionOperator { get; private set; }
public bool Inverted { get; protected set; }
/// <summary>
/// If this not null, <see cref="Conditions"/>[0] is name of an enum variable.
/// </summary>
public Enum EnumValue { get; private set; }
public EnableIfAttributeBase(string condition)
{
ConditionOperator = EConditionOperator.And;
Conditions = new string[1] { condition };
}
public EnableIfAttributeBase(EConditionOperator conditionOperator, params string[] conditions)
{
ConditionOperator = conditionOperator;
Conditions = conditions;
}
public EnableIfAttributeBase(string enumName, Enum enumValue)
: this(enumName)
{
if (enumValue == null)
{
throw new ArgumentNullException(nameof(enumValue), "This parameter must be an enum value.");
}
EnumValue = enumValue;
}
}
}

View file

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

View file

@ -0,0 +1,15 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class FoldoutAttribute : MetaAttribute, IGroupAttribute
{
public string Name { get; private set; }
public FoldoutAttribute(string name)
{
Name = name;
}
}
}

View file

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

View file

@ -0,0 +1,26 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class HideIfAttribute : ShowIfAttributeBase
{
public HideIfAttribute(string condition)
: base(condition)
{
Inverted = true;
}
public HideIfAttribute(EConditionOperator conditionOperator, params string[] conditions)
: base(conditionOperator, conditions)
{
Inverted = true;
}
public HideIfAttribute(string enumName, object enumValue)
: base(enumName, enumValue as Enum)
{
Inverted = true;
}
}
}

View file

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

View file

@ -0,0 +1,8 @@
using UnityEngine;
namespace NaughtyAttributes
{
public interface IGroupAttribute
{
}
}

View file

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

View file

@ -0,0 +1,15 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class LabelAttribute : MetaAttribute
{
public string Label { get; private set; }
public LabelAttribute(string label)
{
Label = label;
}
}
}

View file

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

View file

@ -0,0 +1,8 @@
using System;
namespace NaughtyAttributes
{
public class MetaAttribute : Attribute, INaughtyAttribute
{
}
}

View file

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

View file

@ -0,0 +1,15 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = true, Inherited = true)]
public class OnValueChangedAttribute : MetaAttribute
{
public string CallbackName { get; private set; }
public OnValueChangedAttribute(string callbackName)
{
CallbackName = callbackName;
}
}
}

View file

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

View file

@ -0,0 +1,10 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class ReadOnlyAttribute : MetaAttribute
{
}
}

View file

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

View file

@ -0,0 +1,26 @@
using System;
namespace NaughtyAttributes
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class ShowIfAttribute : ShowIfAttributeBase
{
public ShowIfAttribute(string condition)
: base(condition)
{
Inverted = false;
}
public ShowIfAttribute(EConditionOperator conditionOperator, params string[] conditions)
: base(conditionOperator, conditions)
{
Inverted = false;
}
public ShowIfAttribute(string enumName, object enumValue)
: base(enumName, enumValue as Enum)
{
Inverted = false;
}
}
}

View file

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

View file

@ -0,0 +1,39 @@
using System;
namespace NaughtyAttributes
{
public class ShowIfAttributeBase : MetaAttribute
{
public string[] Conditions { get; private set; }
public EConditionOperator ConditionOperator { get; private set; }
public bool Inverted { get; protected set; }
/// <summary>
/// If this not null, <see cref="Conditions"/>[0] is name of an enum variable.
/// </summary>
public Enum EnumValue { get; private set; }
public ShowIfAttributeBase(string condition)
{
ConditionOperator = EConditionOperator.And;
Conditions = new string[1] { condition };
}
public ShowIfAttributeBase(EConditionOperator conditionOperator, params string[] conditions)
{
ConditionOperator = conditionOperator;
Conditions = conditions;
}
public ShowIfAttributeBase(string enumName, Enum enumValue)
: this(enumName)
{
if (enumValue == null)
{
throw new ArgumentNullException(nameof(enumValue), "This parameter must be an enum value.");
}
EnumValue = enumValue;
}
}
}

View file

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

View file

@ -0,0 +1,12 @@
{
"name": "NaughtyAttributes.Core",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 776d03a35f1b52c4a9aed9f56d7b4229
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

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

View file

@ -0,0 +1,56 @@
using UnityEngine;
namespace NaughtyAttributes
{
public enum EColor
{
Clear,
White,
Black,
Gray,
Red,
Pink,
Orange,
Yellow,
Green,
Blue,
Indigo,
Violet
}
public static class EColorExtensions
{
public static Color GetColor(this EColor color)
{
switch (color)
{
case EColor.Clear:
return new Color32(0, 0, 0, 0);
case EColor.White:
return new Color32(255, 255, 255, 255);
case EColor.Black:
return new Color32(0, 0, 0, 255);
case EColor.Gray:
return new Color32(128, 128, 128, 255);
case EColor.Red:
return new Color32(255, 0, 63, 255);
case EColor.Pink:
return new Color32(255, 152, 203, 255);
case EColor.Orange:
return new Color32(255, 128, 0, 255);
case EColor.Yellow:
return new Color32(255, 211, 0, 255);
case EColor.Green:
return new Color32(98, 200, 79, 255);
case EColor.Blue:
return new Color32(0, 135, 189, 255);
case EColor.Indigo:
return new Color32(75, 0, 130, 255);
case EColor.Violet:
return new Color32(128, 0, 255, 255);
default:
return new Color32(0, 0, 0, 255);
}
}
}
}

View file

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

View file

@ -0,0 +1,10 @@
using System;
namespace NaughtyAttributes
{
public enum EConditionOperator
{
And,
Or
}
}

View file

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

View file

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

View file

@ -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;
}
}
}

View file

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

View file

@ -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;
}
}
}

View file

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

View file

@ -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;
}
}
}

View file

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

View file

@ -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;
}
}
}

View file

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

View file

@ -0,0 +1,8 @@
using System;
namespace NaughtyAttributes
{
public class ValidatorAttribute : Attribute, INaughtyAttribute
{
}
}

View file

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

View file

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: b76068e69df25a94ab378b0b6829c4f0
folderAsset: yes
timeCreated: 1507995613
licenseType: Store
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

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

View file

@ -0,0 +1,23 @@
using UnityEngine;
using UnityEditor;
namespace NaughtyAttributes.Editor
{
[CustomPropertyDrawer(typeof(HorizontalLineAttribute))]
public class HorizontalLineDecoratorDrawer : DecoratorDrawer
{
public override float GetHeight()
{
HorizontalLineAttribute lineAttr = (HorizontalLineAttribute)attribute;
return EditorGUIUtility.singleLineHeight + lineAttr.Height;
}
public override void OnGUI(Rect position)
{
Rect rect = EditorGUI.IndentedRect(position);
rect.y += EditorGUIUtility.singleLineHeight / 3.0f;
HorizontalLineAttribute lineAttr = (HorizontalLineAttribute)attribute;
NaughtyEditorGUI.HorizontalLine(rect, lineAttr.Height, lineAttr.Color.GetColor());
}
}
}

View file

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

Some files were not shown because too many files have changed in this diff Show more