AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
HeadsetAdjustment.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 
4 using UnityEngine;
5 using UnityEngine.SceneManagement;
7 
8 namespace HoloToolkit.Unity
9 {
10  public class HeadsetAdjustment : MonoBehaviour, IInputClickHandler, ISpeechHandler
11  {
12  public string NextSceneName;
13 
14  private void Start()
15  {
16  InputManager.Instance.AddGlobalListener(gameObject);
17  }
18 
19  public void OnInputClicked(InputClickedEventData eventData)
20  {
21  GotoNextScene();
22  }
23 
25  {
26  GotoNextScene();
27  }
28 
29  private void GotoNextScene()
30  {
31  InputManager.Instance.RemoveGlobalListener(gameObject);
32 
33  if (!string.IsNullOrEmpty(NextSceneName))
34  {
35  SceneManager.LoadScene(NextSceneName);
36  }
37  else
38  {
39  int sceneIndex = SceneManager.GetActiveScene().buildIndex;
40  SceneManager.LoadScene(sceneIndex + 1);
41  }
42  }
43  }
44 }
Input Manager is responsible for managing input sources and dispatching relevant events to the approp...
Definition: InputManager.cs:19
Interface to implement to react to simple click input.
void OnInputClicked(InputClickedEventData eventData)
static T Instance
Returns the Singleton instance of the classes type. If no instance is found, then we search for an in...
Definition: Singleton.cs:26
void OnSpeechKeywordRecognized(SpeechEventData eventData)
Describes an input event that involves keyword recognition.
Interface to implement to react to speech recognition.
Describes an input event that involves a tap.