Class CoreServices
Utility class to easily access references to core runtime Mixed Reality Toolkit Services If deallocating and re-allocating a new system at runtime, ResetCacheReferences() should be used to get a proper reference
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit
Assembly: cs.temp.dll.dll
Syntax
public static class CoreServices
Properties
BoundarySystem
Cached reference to the active instance of the boundary system. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealityBoundarySystem BoundarySystem { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityBoundarySystem |
CameraSystem
Cached reference to the active instance of the camera system. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealityCameraSystem CameraSystem { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityCameraSystem |
DiagnosticsSystem
Cached reference to the active instance of the diagnostics system. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealityDiagnosticsSystem DiagnosticsSystem { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityDiagnosticsSystem |
FocusProvider
Cached reference to the active instance of the focus provider. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealityFocusProvider FocusProvider { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityFocusProvider |
InputSystem
Cached reference to the active instance of the input system. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealityInputSystem InputSystem { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityInputSystem |
RaycastProvider
Cached reference to the active instance of the raycast provider. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealityRaycastProvider RaycastProvider { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityRaycastProvider |
SceneSystem
Cached reference to the active instance of the scene system. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealitySceneSystem SceneSystem { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealitySceneSystem |
SpatialAwarenessSystem
Cached reference to the active instance of the spatial awareness system. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealitySpatialAwarenessSystem SpatialAwarenessSystem { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealitySpatialAwarenessSystem |
TeleportSystem
Cached reference to the active instance of the teleport system. If system is destroyed, reference will be invalid. Please use ResetCacheReferences()
Declaration
public static IMixedRealityTeleportSystem TeleportSystem { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityTeleportSystem |
Methods
GetCameraSystemDataProvider<T>()
Gets first matching IMixedRealityCameraSettingsProvider or extension thereof for CoreServices.CameraSystem
Declaration
public static T GetCameraSystemDataProvider<T>()
where T : IMixedRealityCameraSettingsProvider
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetDataProvider<T>(IMixedRealityService)
Gets first matching data provider of provided type T registered to the provided mixed reality service.
Declaration
public static T GetDataProvider<T>(IMixedRealityService service)
where T : IMixedRealityDataProvider
Parameters
| Type | Name | Description |
|---|---|---|
| IMixedRealityService | service | This function will attempt to get first available data provider registered to this service. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | Type of data provider to return. Must implement and/or extend from IMixedRealityDataProvider |
Remarks
Service parameter is expected to implement IMixedRealityDataProviderAccess. If not, then will return default(T)
GetInputSystemDataProvider<T>()
Gets first matching IMixedRealityInputDeviceManager or extension thereof for CoreServices.InputSystem
Declaration
public static T GetInputSystemDataProvider<T>()
where T : IMixedRealityInputDeviceManager
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
GetSpatialAwarenessSystemDataProvider<T>()
Gets first matching IMixedRealitySpatialAwarenessObserver or extension thereof for CoreServices.SpatialAwarenessSystem
Declaration
public static T GetSpatialAwarenessSystemDataProvider<T>()
where T : IMixedRealitySpatialAwarenessObserver
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
ResetCacheReference(Type)
Clears the cache of the reference with key of given type if present and applicable
Declaration
public static bool ResetCacheReference(Type serviceType)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | serviceType | interface of service to key against. Must be of type IMixedRealityService |
Returns
| Type | Description |
|---|---|
| Boolean | true if successfully cleared, false otherwise |
ResetCacheReferences()
Resets all cached system references to null
Declaration
public static void ResetCacheReferences()