5 using System.Collections.Generic;
14 [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
18 public override void DrawEditor(
UnityEngine.Object target, FieldInfo field, SerializedProperty property)
20 int enumValue = Convert.ToInt32(field.GetValue(target));
21 List<string> displayOptions =
new List<string>();
22 foreach (
object value
in Enum.GetValues(field.FieldType))
24 displayOptions.Add(value.ToString());
26 enumValue = EditorGUILayout.MaskField(SplitCamelCase(field.Name), enumValue, displayOptions.ToArray());
29 public override void DrawEditor(
UnityEngine.Object target, PropertyInfo prop)
31 int enumValue = Convert.ToInt32(prop.GetValue(target, null));
32 List<string> displayOptions =
new List<string>();
33 foreach (
object value
in Enum.GetValues(prop.PropertyType))
35 displayOptions.Add(value.ToString());
37 enumValue = EditorGUILayout.MaskField(SplitCamelCase(prop.Name), enumValue, displayOptions.ToArray());