Skip to content

Commit 2b5a659

Browse files
author
David Kline (ANALOG)
committed
missed committing a file
1 parent 43076e1 commit 2b5a659

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Assets/MixedRealityToolkit/_Core/Services/MixedRealityToolkit.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.MixedReality.Toolkit.Core.Interfaces.BoundarySystem;
88
using Microsoft.MixedReality.Toolkit.Core.Interfaces.Diagnostics;
99
using Microsoft.MixedReality.Toolkit.Core.Interfaces.InputSystem;
10+
using Microsoft.MixedReality.Toolkit.Core.Interfaces.SpatialAwarenessSystem;
1011
using Microsoft.MixedReality.Toolkit.Core.Interfaces.TeleportSystem;
1112
using Microsoft.MixedReality.Toolkit.Core.Utilities;
1213
using System;
@@ -195,6 +196,16 @@ private void Initialize()
195196
}
196197

197198

199+
// If the Spatial Awareness system has been selected for initialization in the Active profile, enable it in the project
200+
if (ActiveProfile.IsSpatialAwarenessSystemEnabled)
201+
{
202+
if (!RegisterService(typeof(IMixedRealitySpatialAwarenessSystem), Activator.CreateInstance(ActiveProfile.SpatialAwarenessSystemSystemType) as IMixedRealitySpatialAwarenessSystem) ||
203+
SpatialAwarenessSystem == null)
204+
{
205+
Debug.LogError("Failed to start the Spatial Awareness System!");
206+
}
207+
}
208+
198209
// If the Teleport system has been selected for initialization in the Active profile, enable it in the project
199210
if (ActiveProfile.IsTeleportSystemEnabled)
200211
{
@@ -1030,6 +1041,7 @@ private bool IsCoreSystem(Type type)
10301041
return typeof(IMixedRealityInputSystem).IsAssignableFrom(type) ||
10311042
typeof(IMixedRealityTeleportSystem).IsAssignableFrom(type) ||
10321043
typeof(IMixedRealityBoundarySystem).IsAssignableFrom(type) ||
1044+
typeof(IMixedRealitySpatialAwarenessSystem).IsAssignableFrom(type) ||
10331045
typeof(IMixedRealityDiagnosticsSystem).IsAssignableFrom(type);
10341046
}
10351047

@@ -1160,6 +1172,13 @@ private static bool CheckComponentMatch(Type type, string serviceName, Tuple<Typ
11601172
/// </summary>
11611173
public static IMixedRealityBoundarySystem BoundarySystem => boundarySystem ?? (boundarySystem = Instance.GetService<IMixedRealityBoundarySystem>());
11621174

1175+
private static IMixedRealitySpatialAwarenessSystem spatialAwarenessSystem = null;
1176+
1177+
/// <summary>
1178+
/// The current Spatial Awareness System registered with the Mixed Reality Manager.
1179+
/// </summary>
1180+
public static IMixedRealitySpatialAwarenessSystem SpatialAwarenessSystem => spatialAwarenessSystem ?? (spatialAwarenessSystem = Instance.GetService<IMixedRealitySpatialAwarenessSystem>());
1181+
11631182
private static IMixedRealityTeleportSystem teleportSystem = null;
11641183

11651184
/// <summary>

0 commit comments

Comments
 (0)