SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
913 B

4 years ago
  1. using UnityEngine;
  2. using UnityEngine.XR.ARFoundation;
  3. namespace UnityEditor.XR.ARFoundation
  4. {
  5. /// <summary>
  6. /// A custom property drawer for the <c>PlaneDetectionMode</c> enum.
  7. /// </summary>
  8. [CustomPropertyDrawer(typeof(PlaneDetectionModeMaskAttribute))]
  9. class PlaneDetectionModeMaskAttributeDrawer : PropertyDrawer
  10. {
  11. string[] m_EnumNames;
  12. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
  13. {
  14. // Remove the "None" option
  15. if (m_EnumNames == null)
  16. {
  17. m_EnumNames = new string[property.enumNames.Length - 1];
  18. for (int i = 1; i < property.enumNames.Length; ++i)
  19. m_EnumNames[i - 1] = property.enumNames[i];
  20. }
  21. property.intValue = EditorGUI.MaskField(position, label, property.intValue, m_EnumNames);
  22. }
  23. }
  24. }