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;
7
using
HoloToolkit
.
Unity
.
InputModule
;
8
9
namespace
HoloToolkit
.Examples.InteractiveElements
10
{
18
public
class
InteractiveButton
:
Interactive
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
}
HoloToolkit.Unity.InputModule
Definition:
AnimatedCursor.cs:7
System
HoloToolkit.Examples.InteractiveElements.InteractiveButton.OnGazeLeaveEvents
UnityEvent OnGazeLeaveEvents
Definition:
InteractiveButton.cs:22
HoloToolkit.Examples.InteractiveElements.InteractiveButton.OnFocusEnter
override void OnFocusEnter()
The gameObject received gaze
Definition:
InteractiveButton.cs:29
HoloToolkit.Examples.InteractiveElements.InteractiveButton.OnInputUp
override void OnInputUp(InputEventData eventData)
All tab, hold, and gesture events are completed
Definition:
InteractiveButton.cs:58
HoloToolkit.Examples.InteractiveElements.InteractiveButton.OnUpEvents
UnityEvent OnUpEvents
Definition:
InteractiveButton.cs:24
HoloToolkit.Examples.InteractiveElements.InteractiveButton.OnDownEvents
UnityEvent OnDownEvents
Definition:
InteractiveButton.cs:23
HoloToolkit.Examples.InteractiveElements.InteractiveButton.OnInputDown
override void OnInputDown(InputEventData eventData)
The user is initiating a tap or hold
Definition:
InteractiveButton.cs:48
HoloToolkit
HoloToolkit.Examples.InteractiveElements.InteractiveButton.OnGazeEnterEvents
UnityEvent OnGazeEnterEvents
Definition:
InteractiveButton.cs:21
HoloToolkit.Unity.InputModule.InputEventData
Describes an input event that has a source id and a press kind.
Definition:
InputEventData.cs:11
HoloToolkit.Examples.InteractiveElements.InteractiveButton.OnFocusExit
override void OnFocusExit()
The gameObject no longer has gaze
Definition:
InteractiveButton.cs:39
HoloToolkit.Examples.InteractiveElements.InteractiveButton
InteractiveButton exposes extra unity events for gaze, down and hold in the inspector.
Definition:
InteractiveButton.cs:18
HoloToolkit.Examples.InteractiveElements.Interactive
Interactive exposes basic button type events to the Unity Editor and receives messages from the Gestu...
Definition:
Interactive.cs:22
UnityEngine
HoloToolkit.Unity
Assets
HoloToolkit-Examples
UX
Scripts
InteractiveButton.cs
Generated by
1.8.12