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

Public Member Functions

void AddDetector (Detector detector)
 
void RemoveDetector (Detector detector)
 
void AddAllSiblingDetectors ()
 
- Public Member Functions inherited from Leap.Unity.Detector
virtual void Activate ()
 
virtual void Deactivate ()
 

Public Attributes

bool AddAllSiblingDetectorsOnAwake = true
 
LogicType GateType = LogicType.AndGate
 
bool Negate = false
 
- Public Attributes inherited from Leap.Unity.Detector
UnityEvent OnActivate
 
UnityEvent OnDeactivate
 

Protected Member Functions

void CheckDetectors ()
 

Additional Inherited Members

- 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
 
- Properties inherited from Leap.Unity.Detector
bool IsActive [get]
 

Detailed Description

The DetectorLogicGate detector observes other detectors and activates when these other detectors match the specified logic.

A DetectorLogicGate can be configured as an AND gate or an OR gate. You can also negate the output (creating a NAND or NOR gate).

Since a DetectorLogicGate is a Detector, it can observe other DetectorLogicGate instances. However, before constructing complex logic chains, you should consider whether it is better to put such logic into a normal script.

Since
4.1.2

Definition at line 28 of file DetectorLogicGate.cs.

Member Function Documentation

◆ AddAllSiblingDetectors()

void Leap.Unity.DetectorLogicGate.AddAllSiblingDetectors ( )

Adds all the other detectors on the same GameObject to the list of observed detectors.

Note: If you have more than one DetectorLogicGate instance on a game object, make sure that both objects don't observe each other.

Since
4.1.2

Definition at line 93 of file DetectorLogicGate.cs.

◆ AddDetector()

void Leap.Unity.DetectorLogicGate.AddDetector ( Detector  detector)

Adds the specified detector to the list of observed detectors.

The same detector cannot be added more than once.

Parameters
Detectorthe detector to watch.
Since
4.1.2

Definition at line 67 of file DetectorLogicGate.cs.

◆ CheckDetectors()

void Leap.Unity.DetectorLogicGate.CheckDetectors ( )
protected

Checks all the observed detectors, combines them with the specified type of logic and calls the Activate() or Deactivate() function as appropriate.

Since
4.1.2

Definition at line 131 of file DetectorLogicGate.cs.

◆ RemoveDetector()

void Leap.Unity.DetectorLogicGate.RemoveDetector ( Detector  detector)

Removes the specified detector from the list of observed detectors;

Parameters
Detectorthe detector to remove.
Since
4.1.2

Definition at line 80 of file DetectorLogicGate.cs.

Member Data Documentation

◆ AddAllSiblingDetectorsOnAwake

bool Leap.Unity.DetectorLogicGate.AddAllSiblingDetectorsOnAwake = true

When true, all Detector components of the same game object are added to the list of watched detectors on Awake. When false, you must manually add the desired detectors.

If you have more than one DetectorLogicGate component on a game object, do not enable this option on both.

Since
4.1.2

Definition at line 44 of file DetectorLogicGate.cs.

◆ GateType

LogicType Leap.Unity.DetectorLogicGate.GateType = LogicType.AndGate

The type of logic for this gate: AND or OR.

Since
4.1.2

Definition at line 51 of file DetectorLogicGate.cs.

◆ Negate

bool Leap.Unity.DetectorLogicGate.Negate = false

Whether to negate the output of the gate. AND becomes NAND; OR becomes NOR.

Since
4.1.2

Definition at line 58 of file DetectorLogicGate.cs.


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