AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
InteractiveToggleButton.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 System.Collections;
6 using UnityEngine.Events;
8 
9 namespace HoloToolkit.Examples.InteractiveElements
10 {
19  {
20 
21  public UnityEvent OnGazeEnterEvents;
22  public UnityEvent OnGazeLeaveEvents;
23  public UnityEvent OnDownEvents;
24  public UnityEvent OnUpEvents;
25 
29  public override void OnFocusEnter()
30  {
31  base.OnFocusEnter();
32 
33  OnGazeEnterEvents.Invoke();
34  }
35 
39  public override void OnFocusExit()
40  {
41  base.OnFocusExit();
42  OnGazeLeaveEvents.Invoke();
43  }
44 
48  public override void OnInputDown(InputEventData eventData)
49  {
50  base.OnInputDown(eventData);
51 
52  OnDownEvents.Invoke();
53  }
54 
58  public override void OnInputUp(InputEventData eventData)
59  {
60  bool ignoreRelease = mCheckRollOff;
61  base.OnInputUp(eventData);
62  if (!ignoreRelease)
63  {
64  OnUpEvents.Invoke();
65  }
66  }
67  }
68 }
override void OnInputDown(InputEventData eventData)
The user is initiating a tap or hold
override void OnInputUp(InputEventData eventData)
All tab, hold, and gesture events are completed
override void OnFocusExit()
The gameObject no longer has gaze
InteractiveToggleButton expands InteractiveToggle to expose a gaze, down and up state events in the i...
InteractiveToggle expands Interactive to expose selection or toggle states.
Describes an input event that has a source id and a press kind.