AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
InteractiveButton.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 OnFocusEnter()
The gameObject received gaze
override void OnInputUp(InputEventData eventData)
All tab, hold, and gesture events are completed
override void OnInputDown(InputEventData eventData)
The user is initiating a tap or hold
Describes an input event that has a source id and a press kind.
override void OnFocusExit()
The gameObject no longer has gaze
InteractiveButton exposes extra unity events for gaze, down and hold in the inspector.
Interactive exposes basic button type events to the Unity Editor and receives messages from the Gestu...
Definition: Interactive.cs:22