AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
ControllerFinderEditor.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 using UnityEngine;
6 
7 namespace HoloToolkit.Unity.InputModule
8 {
9  [CustomEditor(typeof(ControllerFinder))]
10  public abstract class ControllerFinderEditor : Editor
11  {
12  private SerializedProperty handednessProperty;
13  private SerializedProperty elementProperty;
14 
15  protected virtual void OnEnable()
16  {
17  handednessProperty = serializedObject.FindProperty("handedness");
18  elementProperty = serializedObject.FindProperty("element");
19  }
20 
21  public override void OnInspectorGUI()
22  {
23  serializedObject.Update();
24 
25  EditorGUILayout.Space();
26  EditorGUILayout.LabelField("Controller Options", new GUIStyle("Label") { fontStyle = FontStyle.Bold });
27  EditorGUILayout.Space();
28  EditorGUI.indentLevel++;
29 
30  EditorGUILayout.PropertyField(handednessProperty);
31  EditorGUILayout.PropertyField(elementProperty);
32 
33  EditorGUI.indentLevel--;
34  serializedObject.ApplyModifiedProperties();
35  }
36  }
37 }