summaryrefslogtreecommitdiff
path: root/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-10-15 07:24:10 +0800
committerchai <chaifix@163.com>2020-10-15 07:24:10 +0800
commite846c64d6f927879cb8a095e62d773a8d7b3c9f4 (patch)
tree7882744bbf2b6c7096ec15fb300f088c5a0807c5 /Assets/Plugins/AdvancedInspector/Attributes/Angle.cs
parentcd12e74241678ee3c0752484d310b202187ba24c (diff)
*ability system
Diffstat (limited to 'Assets/Plugins/AdvancedInspector/Attributes/Angle.cs')
-rw-r--r--Assets/Plugins/AdvancedInspector/Attributes/Angle.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs b/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs
new file mode 100644
index 00000000..8b80ade5
--- /dev/null
+++ b/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs
@@ -0,0 +1,34 @@
+using System;
+
+namespace AdvancedInspector
+{
+ /// <summary>
+ /// Turns a float/int into a spinning knob.
+ /// Because... Fancy.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
+ public class AngleAttribute : Attribute, IListAttribute
+ {
+ private float snap = -1;
+
+ /// <summary>
+ /// Makes the control snap to the multiple of that value
+ /// Default; -1. Negative values turn this behaviour off.
+ /// </summary>
+ public float Snap
+ {
+ get { return snap; }
+ }
+
+ public AngleAttribute() { }
+
+ /// <summary>
+ /// If snap is -1, the snap is disable.
+ /// Snap makes the wheel "stick" to multiple of a fixed value.
+ /// </summary>
+ public AngleAttribute(float snap)
+ {
+ this.snap = snap;
+ }
+ }
+} \ No newline at end of file