File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Assets/MRTK/Providers/XRSDK Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 22 "name": "Microsoft.MixedReality.Toolkit.Providers.XRSDK",
33 "references": [
44 "Microsoft.MixedReality.Toolkit",
5+ "Unity.XR.Management",
56 "UnityEngine.SpatialTracking"
67 ],
78 "includePlatforms": [],
1819 "name": "com.unity.xr.legacyinputhelpers",
1920 "expression": "",
2021 "define": "SPATIALTRACKING_ENABLED"
22+ },
23+ {
24+ "name": "com.unity.xr.management",
25+ "expression": "",
26+ "define": "XR_MANAGEMENT_ENABLED"
2127 }
2228 ],
2329 "noEngineReferences": false
Original file line number Diff line number Diff line change 99using UnityEngine ;
1010using UnityEngine . XR ;
1111
12+ #if XR_MANAGEMENT_ENABLED
13+ using UnityEngine . XR . Management ;
14+ #endif // XR_MANAGEMENT_ENABLED
15+
1216namespace Microsoft . MixedReality . Toolkit . XRSDK . Input
1317{
1418 /// <summary>
@@ -52,6 +56,22 @@ public virtual bool CheckCapability(MixedRealityCapability capability)
5256 InputDeviceCharacteristics . HandTracking
5357 } ;
5458
59+ #if XR_MANAGEMENT_ENABLED
60+ /// <summary>
61+ /// Checks if the active loader has a specific name. Used in cases where the loader class is internal, like WindowsMRLoader.
62+ /// </summary>
63+ /// <param name="loaderName">The string name to compare against the active loader.</param>
64+ /// <returns>True if the active loader has the same name as the parameter.</returns>
65+ protected virtual bool IsLoaderActive ( string loaderName ) => XRGeneralSettings . Instance . Manager . activeLoader . name == loaderName ;
66+
67+ /// <summary>
68+ /// Checks if the active loader is of a specific type. Used in cases where the loader class is accessible, like OculusLoader.
69+ /// </summary>
70+ /// <typeparam name="T">The loader class type to check against the active loader.</typeparam>
71+ /// <returns>True if the active loader is of the specified type.</returns>
72+ protected virtual bool IsLoaderActive < T > ( ) where T : XRLoader => XRGeneralSettings . Instance . Manager . activeLoader is T ;
73+ #endif // XR_MANAGEMENT_ENABLED
74+
5575 private static readonly ProfilerMarker UpdatePerfMarker = new ProfilerMarker ( "[MRTK] XRSDKDeviceManager.Update" ) ;
5676
5777 /// <inheritdoc/>
You can’t perform that action at this time.
0 commit comments