AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
GamePadHandlerBase.cs
Go to the documentation of this file.
1
using
UnityEngine
;
2
3
namespace
HoloToolkit
.Unity.InputModule
4
{
5
public
class
GamePadHandlerBase
: MonoBehaviour,
ISourceStateHandler
6
{
7
[SerializeField]
8
[Tooltip(
"True, if gaze is not required for Input"
)]
9
protected
bool
IsGlobalListener =
true
;
10
11
protected
string
GamePadName =
string
.Empty;
12
13
private
void
OnEnable()
14
{
15
if
(IsGlobalListener)
16
{
17
InputManager
.
Instance
.AddGlobalListener(gameObject);
18
}
19
}
20
21
protected
virtual
void
OnDisable
()
22
{
23
if
(IsGlobalListener &&
InputManager
.
Instance
!= null)
24
{
25
InputManager
.
Instance
.RemoveGlobalListener(gameObject);
26
}
27
}
28
29
public
virtual
void
OnSourceDetected
(
SourceStateEventData
eventData)
30
{
31
// Override and name your GamePad source.
32
}
33
34
public
virtual
void
OnSourceLost
(
SourceStateEventData
eventData)
35
{
36
GamePadName =
string
.Empty;
37
}
38
}
39
}
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.GamePadHandlerBase.OnSourceLost
virtual void OnSourceLost(SourceStateEventData eventData)
Definition:
GamePadHandlerBase.cs:34
HoloToolkit.Unity.InputModule.GamePadHandlerBase
Definition:
GamePadHandlerBase.cs:5
HoloToolkit.Unity.InputModule.GamePadHandlerBase.OnSourceDetected
virtual void OnSourceDetected(SourceStateEventData eventData)
Definition:
GamePadHandlerBase.cs:29
HoloToolkit.Unity.InputModule.GamePadHandlerBase.OnDisable
virtual void OnDisable()
Definition:
GamePadHandlerBase.cs:21
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.ISourceStateHandler
Interface to implement to react to source state changes, such as when an input source is detected or ...
Definition:
ISourceStateHandler.cs:11
HoloToolkit
HoloToolkit.Unity.InputModule.SourceStateEventData
Describes an source state event that has a source id.
Definition:
SourceStateEventData.cs:11
UnityEngine
Assets
HoloToolkit
Input
Scripts
GamePad
GamePadHandlerBase.cs
Generated by
1.8.12