AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
ToggleDebugWindow.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 using UnityEngine;
5 
6 namespace HoloToolkit.Unity
7 {
11  public class ToggleDebugWindow : MonoBehaviour, IInputClickHandler
12  {
16  private bool debugEnabled = false;
17 
21  public GameObject DebugWindow;
22 
23  private void Start()
24  {
25  UpdateChildren();
26  }
27 
32  public void OnInputClicked(InputClickedEventData eventData)
33  {
34  debugEnabled = !debugEnabled;
35  UpdateChildren();
36  eventData.Use();
37  }
38 
42  private void UpdateChildren()
43  {
44  DebugWindow.SetActive(debugEnabled);
45  }
46  }
47 }
Toggles if the debug window is visible or not.
void OnInputClicked(InputClickedEventData eventData)
When the user clicks this control, we toggle the state of the DebugWindow
Interface to implement to react to simple click input.
GameObject DebugWindow
The debug window.
Describes an input event that involves a tap.