示例#1
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            var tp = this.fieldInfo.FieldType;

            if (TypeUtil.IsListType(tp))
            {
                tp = TypeUtil.GetElementTypeOfListType(tp);
            }
            if (!tp.IsEnum)
            {
                SPEditorGUI.DefaultPropertyField(position, property, label);
                return;
            }

            System.Enum e = property.GetEnumValue(tp);
            e = SPEditorGUI.EnumPopup(position, label, e);
            property.SetEnumValue(e);
        }