EnumMultiAttributeDrawer.cs 482 B

123456789101112131415161718
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEditor;
  4. using UnityEngine;
  5. namespace SC.XR.Unity
  6. {
  7. [CustomPropertyDrawer(typeof(EnumMultiAttribute))]
  8. public class EnumMultiAttributeDrawer : PropertyDrawer
  9. {
  10. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
  11. {
  12. property.intValue = EditorGUI.MaskField(position, label, property.intValue, property.enumNames);
  13. }
  14. }
  15. }