HoloLens 2 Gait Training
The purpose of this project is to create gait training application.
Loading...
Searching...
No Matches
ToggleUIVisibility.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
8public class ToggleUIVisibility : MonoBehaviour
9{
11 [SerializeField] private GameObject m_ParentAvatarUI;
12
14 [SerializeField] private GameObject m_NoiseUI;
15
17 [SerializeField] private GameObject m_NoiseDataPanel;
18
20 private bool m_IsMeshToggled = true;
21
23 private bool m_ToggleDiagnosticFlag = false;
24
27 public void ToggleAvatarUI()
28 {
29 bool isObjectActive = m_ParentAvatarUI.activeSelf;
30 isObjectActive = !isObjectActive;
31 m_ParentAvatarUI.SetActive(isObjectActive);
32 }
33
36 public void ToggleNoiseUI()
37 {
38 bool isObjectActive = m_NoiseUI.activeSelf;
39 isObjectActive = !isObjectActive;
40 m_NoiseUI.SetActive(isObjectActive);
41 }
42
46 {
47 bool isObjectActive = m_NoiseDataPanel.activeSelf;
48 isObjectActive = !isObjectActive;
49 m_NoiseDataPanel.SetActive(isObjectActive);
50 }
51
57 {
59 {
60 Microsoft.MixedReality.Toolkit.CoreServices.DiagnosticsSystem.ShowDiagnostics = false;
62 }
63 else
64 {
65 Microsoft.MixedReality.Toolkit.CoreServices.DiagnosticsSystem.ShowDiagnostics = true;
67 }
68 }
69
72 public void ToggleMesh()
73 {
74 var observer = Microsoft.MixedReality.Toolkit.CoreServices.GetSpatialAwarenessSystemDataProvider<Microsoft.MixedReality.Toolkit.XRSDK.OpenXR.OpenXRSpatialAwarenessMeshObserver>();
75
77
78 if( m_IsMeshToggled == true )
79 {
80 observer.DisplayOption = Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshDisplayOptions.Visible;
81 }
82 else
83 {
84 observer.DisplayOption = Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshDisplayOptions.Occlusion;
85 }
86 }
87}
Defines the functionality of the hand-bound UI.
GameObject m_ParentAvatarUI
Reference to the parent object of Avatar UI.
void ToggleDiagnosticProfiler()
Toggle Diagnostic profiler which shows memory and frame rates. Mapped to the 3rd button in hand bound...
void ToggleMesh()
Toggle SpartialMesh Activate by wireframe button located above the avatar panel.
bool m_ToggleDiagnosticFlag
Toggle the diagnostic system.
void ToggleNoiseUI()
Toggle Noise UI You can toggle this UI via voice command or hand-bound menu.
bool m_IsMeshToggled
Toggle the mesh visibility.
GameObject m_NoiseUI
Reference to the parent object of Noise UI.
void ToggleNoiseDataPanel()
Toggle Noise Data Panel You can toggle this UI via voice command or hand-bound menu.
GameObject m_NoiseDataPanel
Reference to the parent object of Noise Data Panel.
void ToggleAvatarUI()
Toggle Avatar UI You can toggle this UI via voice command or hand-bound menu.