BaseServiceManager.GetService<T>(String, Boolean) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the instance of the registered service.
C#
public T GetService<T> (string name = default, bool showLogs = true) where T : Microsoft.MixedReality.Toolkit.IMixedRealityService;
abstract member GetService : string * bool -> 'T (requires 'T :> Microsoft.MixedReality.Toolkit.IMixedRealityService)
override this.GetService : string * bool -> 'T (requires 'T :> Microsoft.MixedReality.Toolkit.IMixedRealityService)
Public Function GetService(Of T As IMixedRealityService) (Optional name As String = Nothing, Optional showLogs As Boolean = true) As T
- T
The interface type of the service (ex: IMixedRealityBoundarySystem).
- name
- String
The name of the service.
- showLogs
- Boolean
Indicates whether or not diagnostic logging should be performed in case of an error
T
The registered service instance as the requested type.
Product | Versions |
---|---|
MRTK2 Unity 2018 | 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0 |
MRTK2 Unity 2019 | 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0 |
MRTK2 Unity 2020 | 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0 |