AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
ProfileInspector.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 UnityEngine;
5 #if UNITY_EDITOR
6 using UnityEditor;
7 #endif
8 
9 namespace HoloToolkit.Unity
10 {
19  #if UNITY_EDITOR
20  public abstract class ProfileInspector : MRTKEditor
21  {
22  public Component targetComponent;
23 
24  protected override bool DisplayHeader
25  {
26  get
27  {
28  return targetComponent == null;
29  }
30  }
31 
32  protected override void BeginInspectorStyle()
33  {
34  if (targetComponent == null)
35  {
36  GUI.color = profileColor;
37  EditorGUILayout.BeginVertical(EditorStyles.helpBox);
38  GUI.color = Color.Lerp(profileColor, Color.red, 0.5f);
39  EditorGUILayout.LabelField("(Warning: this section edits the button profile. These changes will affect all objects that use this profile.)", EditorStyles.wordWrappedMiniLabel);
40  GUI.color = defaultColor;
41  }
42  }
43 
44  protected override void EndInspectorStyle()
45  {
46  if (targetComponent == null)
47  {
48  EditorGUILayout.EndVertical();
49  }
50  }
51  }
52  #endif
53 }