// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Diagnostics { /// /// Class that exposes methods to show/hide the visual profiler /// [AddComponentMenu("Scripts/MRTK/Services/VisualProfilerControl")] public class VisualProfilerControl : MonoBehaviour { public void ToggleProfiler() { if (CoreServices.DiagnosticsSystem != null) { CoreServices.DiagnosticsSystem.ShowProfiler = !CoreServices.DiagnosticsSystem.ShowProfiler; } } public void SetProfilerVisibility(bool isVisible) { if (CoreServices.DiagnosticsSystem != null) { CoreServices.DiagnosticsSystem.ShowProfiler = isVisible; } } } }