AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
EnumFlagsPropertyDrawer.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Reflection;
4 using System.Text.RegularExpressions;
5 using UnityEngine;
6 #if UNITY_EDITOR
7 using UnityEditor;
8 #endif
9 
10 namespace HoloToolkit.Unity
11 {
12 #if UNITY_EDITOR
13  [CustomPropertyDrawer(typeof(EnumFlagsAttribute))]
14  public class EnumFlagsPropertyDrawer : PropertyDrawer
15  {
16  public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
17  {
18  // If we're using MRDL custom editors, let the draw override property handle it
19  if (MRTKEditor.ShowCustomEditors)
20  return;
21 
22  // Otherwise draw a bitmask normally
23  base.OnGUI(position, property, label);
24  }
25  }
26 #endif
27 }