summaryrefslogtreecommitdiff
path: root/Assets/Plugins/AdvancedInspector/Attributes/Angle.cs
diff options
context:
space:
mode:
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