AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
BoundingBoxRigActivityExample.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
HoloToolkit
.
Unity
.
InputModule
;
5
using
UnityEngine
;
6
7
namespace
HoloToolkit
.Unity.Examples.UX
8
{
9
public
class
BoundingBoxRigActivityExample
: MonoBehaviour,
IBoundingBoxStateHandler
10
{
11
public
void
OnBoundingBoxRigActivated
(
BoundingBoxEventData
eventData)
12
{
13
Debug
.LogFormat(
"{0}'s bounding box rig is activated"
, eventData.
BoundingBoxRiggedObject
.name);
14
}
15
16
public
void
OnBoundingBoxRigDeactivated
(
BoundingBoxEventData
eventData)
17
{
18
Debug
.LogFormat(
"{0}'s bounding box rig is deactivated"
, eventData.
BoundingBoxRiggedObject
.name);
19
}
20
21
private
void
Start()
22
{
23
// We have to add a global listener in this case because the focused object is the rig's app bar
24
// So, it will be the app bar which will receive the event, not this listener
25
InputManager
.
Instance
.AddGlobalListener(gameObject);
26
}
27
28
private
void
OnDestroy()
29
{
30
InputManager
.
Instance
.RemoveGlobalListener(gameObject);
31
}
32
}
33
}
HoloToolkit.Unity.InputModule
Definition:
AnimatedCursor.cs:7
HoloToolkit.Unity.InputModule.BoundingBoxEventData
Describes activity of a bounding box rig events.
Definition:
BoundingBoxEventData.cs:12
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.IBoundingBoxStateHandler
Interface to implement reacting to bounding box rig's activation or deactivation. ...
Definition:
IBoundingBoxStateHandler.cs:11
HoloToolkit.Unity.InputModule.BoundingBoxEventData.BoundingBoxRiggedObject
GameObject BoundingBoxRiggedObject
The bounding box rigged object.
Definition:
BoundingBoxEventData.cs:17
HoloToolkit.Unity.Examples.UX.BoundingBoxRigActivityExample
Definition:
BoundingBoxRigActivityExample.cs:9
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.Examples.UX.BoundingBoxRigActivityExample.OnBoundingBoxRigDeactivated
void OnBoundingBoxRigDeactivated(BoundingBoxEventData eventData)
Definition:
BoundingBoxRigActivityExample.cs:16
Debug
HoloToolkit
HoloToolkit.Unity.Examples.UX.BoundingBoxRigActivityExample.OnBoundingBoxRigActivated
void OnBoundingBoxRigActivated(BoundingBoxEventData eventData)
Definition:
BoundingBoxRigActivityExample.cs:11
UnityEngine
HoloToolkit.Unity
Assets
HoloToolkit-Examples
UX
Scripts
BoundingBoxRigActivityExample.cs
Generated by
1.8.12