Skip to content

Commit 6f4cc48

Browse files
forgot to add the new class haha
1 parent 18a0c8b commit 6f4cc48

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using Microsoft.MixedReality.Toolkit.Core.Managers;
2+
using UnityEditor;
3+
4+
namespace Microsoft.MixedReality.Toolkit.Core.Inspectors.Profiles
5+
{
6+
public abstract class BaseMixedRealityInspector : Editor
7+
{
8+
/// <summary>
9+
/// Check and make sure we have a Mixed Reality Manager and an active profile.
10+
/// </summary>
11+
/// <returns>True if the Mixed Reality Manager is properly initialized.</returns>
12+
protected bool CheckMixedRealityManager(bool showHelpBox = true)
13+
{
14+
if (!MixedRealityManager.IsInitialized)
15+
{
16+
// Search the scene for one, in case we've just hot reloaded the assembly.
17+
var managerSearch = FindObjectsOfType<MixedRealityManager>();
18+
19+
if (managerSearch.Length == 0)
20+
{
21+
if (showHelpBox)
22+
{
23+
EditorGUILayout.HelpBox("No Mixed Reality Manager found in scene.", MessageType.Error);
24+
}
25+
return false;
26+
}
27+
28+
MixedRealityManager.ConfirmInitialized();
29+
}
30+
31+
if (!MixedRealityManager.HasActiveProfile)
32+
{
33+
if (showHelpBox)
34+
{
35+
EditorGUILayout.HelpBox("No Active Profile set on the Mixed Reality Manager.", MessageType.Error);
36+
}
37+
return false;
38+
}
39+
40+
return true;
41+
}
42+
}
43+
}

Assets/MixedRealityToolkit/_Core/Inspectors/Profiles/BaseMixedRealityInspector.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)