Class Leap::Unity::ProximityDetector

class Leap.Unity.ProximityDetector : public Leap.Unity.Detector

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

Since

4.1.2

Public Members

ProximityEvent OnProximity

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

Since

4.1.2

float Period = .1f

The interval at which to check palm direction.

Since

4.1.2

GameObject[] TargetObjects

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

Since

4.1.2

string 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

float 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

float 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

bool ShowGizmos = true

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

Since

4.1.2

Properties

GameObject CurrentObject { get; set; }

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