Tanoda
Leap.Unity.ProximityDetector Class Reference
Inheritance diagram for Leap.Unity.ProximityDetector:
Leap.Unity.Detector

Public Attributes

ProximityEvent OnProximity
 
float Period = .1f
 
GameObject[] TargetObjects
 
string TagName = ""
 
bool UseLayersNotList = false
 
LayerMask Layer
 
float OnDistance = .01f
 
float OffDistance = .015f
 
bool ShowGizmos = true
 
- Public Attributes inherited from Leap.Unity.Detector
UnityEvent OnActivate
 
UnityEvent OnDeactivate
 

Protected Member Functions

virtual void OnValidate ()
 

Properties

GameObject CurrentObject [get]
 
- Properties inherited from Leap.Unity.Detector
bool IsActive [get]
 

Additional Inherited Members

- Public Member Functions inherited from Leap.Unity.Detector
virtual void Activate ()
 
virtual void Deactivate ()
 
- Protected Attributes inherited from Leap.Unity.Detector
Color OnColor = Color.green
 
Color OffColor = Color.red
 
Color LimitColor = Color.blue
 
Color DirectionColor = Color.white
 
Color NormalColor = Color.gray
 

Detailed Description

Detects when the parent GameObject is within the specified distance of one of the target objects.

Since
4.1.2

Definition at line 22 of file ProximityDetector.cs.

Member Function Documentation

◆ OnValidate()

virtual void Leap.Unity.ProximityDetector.OnValidate ( )
protectedvirtual

Definition at line 101 of file ProximityDetector.cs.

Member Data Documentation

◆ Layer

LayerMask Leap.Unity.ProximityDetector.Layer

Definition at line 62 of file ProximityDetector.cs.

◆ OffDistance

float Leap.Unity.ProximityDetector.OffDistance = .015f

The distance in meters between this game object and the target game object that will turn off the detector.

Since
4.1.2

Definition at line 80 of file ProximityDetector.cs.

◆ OnDistance

float Leap.Unity.ProximityDetector.OnDistance = .01f

The distance in meters between this game object and the target game object that will pass the proximity check.

Since
4.1.2

Definition at line 72 of file ProximityDetector.cs.

◆ OnProximity

ProximityEvent Leap.Unity.ProximityDetector.OnProximity

Dispatched when the proximity check succeeds. The ProximityEvent object provides a reference to the proximate GameObject.

Since
4.1.2

Definition at line 29 of file ProximityDetector.cs.

◆ Period

float Leap.Unity.ProximityDetector.Period = .1f

The interval at which to check palm direction.

Since
4.1.2

Definition at line 37 of file ProximityDetector.cs.

◆ ShowGizmos

bool Leap.Unity.ProximityDetector.ShowGizmos = true

Whether to draw the detector's Gizmos for debugging. (Not every detector provides gizmos.)

Since
4.1.2

Definition at line 96 of file ProximityDetector.cs.

◆ TagName

string Leap.Unity.ProximityDetector.TagName = ""

Include objects with the specified tag in the list of target objects. Objects are not added dynamically, however, so objects spawned with the tag will not be included.

Since
4.1.3

Definition at line 56 of file ProximityDetector.cs.

◆ TargetObjects

GameObject [] Leap.Unity.ProximityDetector.TargetObjects

The list of objects which can activate the detector by proximity.

Since
4.1.2

Definition at line 46 of file ProximityDetector.cs.

◆ UseLayersNotList

bool Leap.Unity.ProximityDetector.UseLayersNotList = false

Definition at line 59 of file ProximityDetector.cs.

Property Documentation

◆ CurrentObject

GameObject Leap.Unity.ProximityDetector.CurrentObject
get

The object that is close to the activated detector.

If more than one target object is within the required distance, it is undefined which object will be current. Set to null when no targets are close enough.

Since
4.1.2

Definition at line 90 of file ProximityDetector.cs.


The documentation for this class was generated from the following file: