Tanoda
Detector.cs
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) Ultraleap, Inc. 2011-2020. *
3
* *
4
* Use subject to the terms of the Apache License 2.0 available at *
5
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6
* between Ultraleap and you, your company or other organization. *
7
******************************************************************************/
8
9
using
UnityEngine
;
10
using
UnityEngine
.
Events
;
11
using
System.Collections;
12
using
Leap
;
13
14
namespace
Leap.Unity
{
15
32
public
class
Detector
: MonoBehaviour {
36
public
bool
IsActive
{
get
{
return
_isActive;}}
37
private
bool
_isActive =
false
;
41
[Tooltip(
"Dispatched when condition is detected."
)]
42
public
UnityEvent
OnActivate
;
46
[Tooltip(
"Dispatched when condition is no longer detected."
)]
47
public
UnityEvent
OnDeactivate
;
48
54
public
virtual
void
Activate
(){
55
if
(!
IsActive
) {
56
_isActive =
true
;
57
OnActivate
.Invoke();
58
}
59
}
60
66
public
virtual
void
Deactivate
(){
67
if
(
IsActive
) {
68
_isActive =
false
;
69
OnDeactivate
.Invoke();
70
}
71
}
72
73
//Gizmo colors
74
protected
Color
OnColor
=
Color
.green;
75
protected
Color
OffColor
=
Color
.red;
76
protected
Color
LimitColor
=
Color
.blue;
77
protected
Color
DirectionColor
=
Color
.white;
78
protected
Color
NormalColor
=
Color
.gray;
79
80
}
81
}
Color
UnityEngine.Color Color
Definition:
TestScript.cs:32
Leap.Unity.Detector
Definition:
Detector.cs:32
Leap.Unity.Detector.NormalColor
Color NormalColor
Definition:
Detector.cs:78
Leap.Unity.Detector.OnActivate
UnityEvent OnActivate
Definition:
Detector.cs:42
Leap.Unity.Detector.Deactivate
virtual void Deactivate()
Definition:
Detector.cs:66
Leap.Unity.Detector.OnDeactivate
UnityEvent OnDeactivate
Definition:
Detector.cs:47
Leap.Unity.Detector.IsActive
bool IsActive
Definition:
Detector.cs:36
Leap.Unity.Detector.OffColor
Color OffColor
Definition:
Detector.cs:75
Leap.Unity.Detector.DirectionColor
Color DirectionColor
Definition:
Detector.cs:77
Leap.Unity.Detector.LimitColor
Color LimitColor
Definition:
Detector.cs:76
Leap.Unity.Detector.OnColor
Color OnColor
Definition:
Detector.cs:74
Leap.Unity.Detector.Activate
virtual void Activate()
Definition:
Detector.cs:54
Leap.Unity
Definition:
AssetFolderPropertyDrawer.cs:15
Leap
Definition:
AssetFolderPropertyDrawer.cs:15
UnityEngine.Events
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Plugins
LeapMotion
Core
Scripts
DetectionUtilities
Detector.cs
Generated by
1.9.3