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 
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 }
Input Manager is responsible for managing input sources and dispatching relevant events to the approp...
Definition: InputManager.cs:19
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
void OnInputUp(InputEventData eventData)
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
Focus manager is the bridge that handles different types of pointing sources like gaze cursor or poin...
Definition: FocusManager.cs:16
InteractionSourcePressInfo PressType
Button type that initiated the event.
Interface to implement to react to simple pointer-like input.
Describes an input event that has a source id and a press kind.
void OnInputDown(InputEventData eventData)