AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
SurfaceMeshesToPlanesEditor.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEditor;
5 
6 namespace HoloToolkit.Unity.SpatialMapping
7 {
11  [CustomEditor(typeof(SurfaceMeshesToPlanes))]
12  public class SurfaceMeshesToPlanesEditor : Editor
13  {
14  private SerializedProperty drawPlanesMask;
15  private SerializedProperty destroyPlanesMask;
16 
17  private void OnEnable()
18  {
19  drawPlanesMask = serializedObject.FindProperty("drawPlanesMask");
20  destroyPlanesMask = serializedObject.FindProperty("destroyPlanesMask");
21  }
22 
23  public override void OnInspectorGUI()
24  {
25  base.OnInspectorGUI();
26  serializedObject.Update();
27 
28 #if UNITY_2017_3_OR_NEWER
29  drawPlanesMask.intValue = (int)((PlaneTypes)EditorGUILayout.EnumFlagsField("Draw Planes",
30  (PlaneTypes)drawPlanesMask.intValue));
31 #else
32  drawPlanesMask.intValue = (int)((PlaneTypes)EditorGUILayout.EnumMaskField("Draw Planes",
33  (PlaneTypes)drawPlanesMask.intValue));
34 #endif
35 
36 #if UNITY_2017_3_OR_NEWER
37  destroyPlanesMask.intValue = (int)((PlaneTypes)EditorGUILayout.EnumFlagsField("Destroy Planes",
38  (PlaneTypes)destroyPlanesMask.intValue));
39 #else
40  destroyPlanesMask.intValue = (int)((PlaneTypes)EditorGUILayout.EnumMaskField("Destroy Planes",
41  (PlaneTypes)destroyPlanesMask.intValue));
42 #endif
43 
44  serializedObject.ApplyModifiedProperties();
45  }
46  }
47 }
PlaneTypes
All possible plane types that a SurfacePlane can be.
Definition: SurfacePlane.cs:13
Editor extension class to enable multi-selection of the 'Draw Planes' and 'Destroy Planes' options in...