// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Input;
using Microsoft.MixedReality.Toolkit.Utilities;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.UI
{
///
/// Class that initializes the appearance of the features panel according to the toggled states of the associated features
///
internal class FeaturesPanelVisuals : MonoBehaviour
{
[SerializeField]
private Interactable profilerButton = null;
[SerializeField]
private Interactable handRayButton = null;
[SerializeField]
private Interactable handMeshButton = null;
[SerializeField]
private Interactable handJointsButton = null;
private void Start()
{
profilerButton.IsToggled = (CoreServices.DiagnosticsSystem?.ShowProfiler).GetValueOrDefault(false);
handRayButton.IsToggled = PointerUtils.GetPointerBehavior(Handedness.Any, InputSourceType.Hand) != PointerBehavior.AlwaysOff;
MixedRealityHandTrackingProfile handProfile = null;
if (CoreServices.InputSystem?.InputSystemProfile != null)
{
handProfile = CoreServices.InputSystem.InputSystemProfile.HandTrackingProfile;
}
handMeshButton.IsToggled = handProfile != null && handProfile.EnableHandMeshVisualization;
handJointsButton.IsToggled = handProfile != null && handProfile.EnableHandJointVisualization;
}
}
}