From 38d45d0486c14aa9381b60125f3f1f0dd5835754 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Sat, 28 Oct 2017 00:06:07 +0200 Subject: [PATCH] Fixed enum field inspector --- Scripts/Editor/NodeEditorGUILayout.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Editor/NodeEditorGUILayout.cs b/Scripts/Editor/NodeEditorGUILayout.cs index bdee6c0..f7a2808 100644 --- a/Scripts/Editor/NodeEditorGUILayout.cs +++ b/Scripts/Editor/NodeEditorGUILayout.cs @@ -75,7 +75,6 @@ public class NodeEditorGUILayout { else if (type == typeof(double)) return DoubleField(label, (double) value); else if (type == typeof(long)) return LongField(label, (long) value); else if (type == typeof(bool)) return Toggle(label, (bool) value); - else if (type == typeof(Enum)) return EnumField(label, (Enum) value); else if (type == typeof(string)) return TextField(label, (string) value); else if (type == typeof(Rect)) return RectField(label, (Rect) value); else if (type == typeof(Vector2)) return Vector2Field(label, (Vector2) value); @@ -83,6 +82,7 @@ public class NodeEditorGUILayout { else if (type == typeof(Vector4)) return Vector4Field(label, (Vector4) value); else if (type == typeof(Color)) return ColorField(label, (Color) value); else if (type == typeof(AnimationCurve)) return CurveField(label, (AnimationCurve) value); + else if (type.IsSubclassOf(typeof(Enum)) || type == typeof(Enum)) return EnumField(label, (Enum) value); else if (type.IsSubclassOf(typeof(UnityEngine.Object)) || type == typeof(UnityEngine.Object)) return ObjectField(label, (UnityEngine.Object) value, type); else return value; }