summaryrefslogtreecommitdiff
path: root/Assets/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledIndentDrawer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledIndentDrawer.cs')
-rw-r--r--Assets/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledIndentDrawer.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Assets/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledIndentDrawer.cs b/Assets/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledIndentDrawer.cs
new file mode 100644
index 00000000..1f1d2e40
--- /dev/null
+++ b/Assets/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledIndentDrawer.cs
@@ -0,0 +1,25 @@
+// Cristian Pop - https://boxophobic.com/
+
+using UnityEngine;
+using UnityEditor;
+
+namespace Boxophobic.StyledGUI
+{
+ [CustomPropertyDrawer(typeof(StyledIndent))]
+ public class StyledIndentAttributeDrawer : PropertyDrawer
+ {
+ StyledIndent a;
+
+ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+ {
+ a = (StyledIndent)attribute;
+
+ EditorGUI.indentLevel = a.indent;
+ }
+
+ public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
+ {
+ return -2;
+ }
+ }
+}