diff --git a/Editor.meta b/Editor.meta
new file mode 100644
index 0000000..e6d284d
--- /dev/null
+++ b/Editor.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f3f898b36e67bd14c92e03d636f51c7b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Editor/Udexreal.HandDriver.Editor.asmdef b/Editor/Udexreal.HandDriver.Editor.asmdef
index af21d55..5d025d9 100644
--- a/Editor/Udexreal.HandDriver.Editor.asmdef
+++ b/Editor/Udexreal.HandDriver.Editor.asmdef
@@ -1,7 +1,11 @@
{
- "name": "HandDriverUPM.Editor",
+ "name": "HandDriver.Editor",
+ "rootNamespace": "HandDriver.Editor",
"references": [
- "HandDriverUPM.Runtime"
+ "HandDriver.Runtime"
],
- "includePlatforms": [ "Editor" ]
+ "includePlatforms": [
+ "Editor"
+ ],
+ "autoReferenced": true
}
diff --git a/Runtime/NaughtyAttributes.meta b/Runtime/NaughtyAttributes.meta
new file mode 100644
index 0000000..8f55a36
--- /dev/null
+++ b/Runtime/NaughtyAttributes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e96c44af053ca4440bcd4a81d3c29943
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/NaughtyAttributes/Core.meta b/Runtime/NaughtyAttributes/Core.meta
new file mode 100644
index 0000000..b6e4a87
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2e2bd53b151a7f74a962791e3bc33651
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes.meta b/Runtime/NaughtyAttributes/Core/DrawerAttributes.meta
new file mode 100644
index 0000000..132a3c2
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c76425e719cd4424d868674bcfb233f2
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/AllowNestingAttribute.cs b/Runtime/NaughtyAttributes/Core/DrawerAttributes/AllowNestingAttribute.cs
new file mode 100644
index 0000000..b7abb8c
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/AllowNestingAttribute.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace NaughtyAttributes
+{
+ [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
+ public class AllowNestingAttribute : DrawerAttribute
+ {
+ }
+}
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/AllowNestingAttribute.cs.meta b/Runtime/NaughtyAttributes/Core/DrawerAttributes/AllowNestingAttribute.cs.meta
new file mode 100644
index 0000000..343dfec
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/AllowNestingAttribute.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 95b49d3abe880c044adbe7faf6b7b4ec
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/AnimatorParamAttribute.cs b/Runtime/NaughtyAttributes/Core/DrawerAttributes/AnimatorParamAttribute.cs
new file mode 100644
index 0000000..e8d9c2a
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/AnimatorParamAttribute.cs
@@ -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;
+ }
+ }
+}
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/AnimatorParamAttribute.cs.meta b/Runtime/NaughtyAttributes/Core/DrawerAttributes/AnimatorParamAttribute.cs.meta
new file mode 100644
index 0000000..db61add
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/AnimatorParamAttribute.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7373332cb77b42744a415d6b4add445d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/CurveRangeAttribute.cs b/Runtime/NaughtyAttributes/Core/DrawerAttributes/CurveRangeAttribute.cs
new file mode 100644
index 0000000..3e48717
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/CurveRangeAttribute.cs
@@ -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)
+ {
+ }
+ }
+}
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/CurveRangeAttribute.cs.meta b/Runtime/NaughtyAttributes/Core/DrawerAttributes/CurveRangeAttribute.cs.meta
new file mode 100644
index 0000000..93b60ab
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/CurveRangeAttribute.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bbdf3fb8882c7514c9a01108122cda7e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs b/Runtime/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs
new file mode 100644
index 0000000..92e28d5
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs
@@ -0,0 +1,11 @@
+using UnityEngine;
+
+namespace NaughtyAttributes
+{
+ ///
+ /// Base class for all drawer attributes
+ ///
+ public class DrawerAttribute : PropertyAttribute, INaughtyAttribute
+ {
+ }
+}
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs.meta b/Runtime/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs.meta
new file mode 100644
index 0000000..aa54215
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/DrawerAttribute.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9df37fdebccf65c4da5b0a14f6dad5f5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs b/Runtime/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs
new file mode 100644
index 0000000..2bf4702
--- /dev/null
+++ b/Runtime/NaughtyAttributes/Core/DrawerAttributes/DropdownAttribute.cs
@@ -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>
+ {
+ }
+
+ public class DropdownList : IDropdownList
+ {
+ private List> _values;
+
+ public DropdownList()
+ {
+ _values = new List>();
+ }
+
+ public void Add(string displayName, T value)
+ {
+ _values.Add(new KeyValuePair(displayName, value));
+ }
+
+ public IEnumerator> GetEnumerator()
+ {
+ return _values.GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ public static explicit operator DropdownList