// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.MixedReality.Toolkit.Diagnostics; using Microsoft.MixedReality.Toolkit.Utilities; using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Experimental.Diagnostics { /// /// Service manager supporting running the diagnostics system without requiring the MixedRealityToolkit object. /// [AddComponentMenu("Scripts/MRTK/SDK/DiagnosticsSystemManager")] public class DiagnosticsSystemManager : BaseServiceManager { [SerializeField] [Tooltip("The diagnostics system type that will be instantiated.")] [Implements(typeof(IMixedRealityDiagnosticsSystem), TypeGrouping.ByNamespaceFlat)] private SystemType DiagnosticsSystemType = null; [SerializeField] [Tooltip("The diagnostics system configuration profile.")] private MixedRealityDiagnosticsProfile profile = null; private void Awake() { InitializeManager(); } protected override void OnDestroy() { UninitializeManager(); base.OnDestroy(); } /// /// Initialize the manager. /// private void InitializeManager() { // The Diagnostics system class takes arguments for: // * The diagnostics system profile object[] args = { profile }; Initialize(DiagnosticsSystemType.Type, args: args); } /// /// Uninitialize the manager. /// private void UninitializeManager() { Uninitialize(); } } }