AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
TestOverrideFocusedObject.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 
6 namespace HoloToolkit.Unity.InputModule.Tests
7 {
8  public class TestOverrideFocusedObject : MonoBehaviour, IInputClickHandler
9  {
10  private InputManager inputManager;
11  private TextMesh textMesh;
12 
13  private void Start()
14  {
15  inputManager = InputManager.Instance;
16 
17  if (inputManager != null)
18  {
19  inputManager.OverrideFocusedObject = gameObject;
20  }
21 
22  textMesh = FindObjectOfType<TextMesh>();
23  }
24 
25  public void OnInputClicked(InputClickedEventData eventData)
26  {
27  if (textMesh != null && inputManager != null)
28  {
29  textMesh.text = "Air tap worked and OverrideFocusedObject is null.";
30  inputManager.OverrideFocusedObject = null;
31  }
32  }
33  }
34 }
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.
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
GameObject OverrideFocusedObject
To tap on a hologram even when not focused on, set OverrideFocusedObject to desired game object...
Definition: InputManager.cs:36
Describes an input event that involves a tap.