AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
InputHandleCallbackFX.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
InputHandleCallbackFX
: MonoBehaviour,
IInputHandler
9
{
10
[SerializeField]
11
private
ParticleSystem particles = null;
12
13
private
void
Start()
14
{
15
InputManager
.
Instance
.PushFallbackInputHandler(gameObject);
16
}
17
18
void
IInputHandler
.
OnInputDown
(
InputEventData
eventData)
19
{
20
// Nothing.
21
}
22
23
void
IInputHandler
.
OnInputUp
(
InputEventData
eventData)
24
{
25
if
(eventData.
PressType
==
InteractionSourcePressInfo
.Select)
26
{
27
FocusDetails
? focusDetails =
FocusManager
.
Instance
.TryGetFocusDetails(eventData);
28
29
if
(focusDetails != null)
30
{
31
particles.transform.position = focusDetails.Value.
Point
;
32
particles.Emit(60);
33
34
eventData.Use();
// Mark the event as used, so it doesn't fall through to other handlers.
35
}
36
}
37
}
38
}
39
}
HoloToolkit.Unity.InputModule.FocusDetails.Point
Vector3 Point
Definition:
FocusDetails.cs:16
HoloToolkit.Unity.InputModule.InteractionSourcePressInfo
InteractionSourcePressInfo
Definition:
InteractionSourcePressInfo.cs:6
HoloToolkit.Unity.InputModule.InputManager
Input Manager is responsible for managing input sources and dispatching relevant events to the approp...
Definition:
InputManager.cs:19
HoloToolkit.Unity.InputModule.FocusDetails
FocusDetails struct contains information about which game object has the focus currently. Also contains information about the normal of that point.
Definition:
FocusDetails.cs:14
HoloToolkit.Unity.InputModule.IInputHandler.OnInputUp
void OnInputUp(InputEventData eventData)
HoloToolkit.Unity.Singleton.Instance
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
HoloToolkit.Unity.InputModule.FocusManager
Focus manager is the bridge that handles different types of pointing sources like gaze cursor or poin...
Definition:
FocusManager.cs:16
HoloToolkit.Unity.InputModule.InputEventData.PressType
InteractionSourcePressInfo PressType
Button type that initiated the event.
Definition:
InputEventData.cs:16
HoloToolkit.Unity.InputModule.IInputHandler
Interface to implement to react to simple pointer-like input.
Definition:
IInputHandler.cs:11
HoloToolkit
HoloToolkit.Unity.InputModule.Tests.InputHandleCallbackFX
Definition:
InputHandleCallbackFX.cs:8
HoloToolkit.Unity.InputModule.InputEventData
Describes an input event that has a source id and a press kind.
Definition:
InputEventData.cs:11
HoloToolkit.Unity.InputModule.IInputHandler.OnInputDown
void OnInputDown(InputEventData eventData)
UnityEngine
Assets
HoloToolkit-Examples
Input
Scripts
InputHandleCallbackFX.cs
Generated by
1.8.12