Tanoda
|
Public Member Functions | |
void | AddDetector (Detector detector) |
void | RemoveDetector (Detector detector) |
void | AddAllSiblingDetectors () |
![]() | |
virtual void | Activate () |
virtual void | Deactivate () |
Public Attributes | |
bool | AddAllSiblingDetectorsOnAwake = true |
LogicType | GateType = LogicType.AndGate |
bool | Negate = false |
![]() | |
UnityEvent | OnActivate |
UnityEvent | OnDeactivate |
Protected Member Functions | |
void | CheckDetectors () |
Additional Inherited Members | |
![]() | |
Color | OnColor = Color.green |
Color | OffColor = Color.red |
Color | LimitColor = Color.blue |
Color | DirectionColor = Color.white |
Color | NormalColor = Color.gray |
![]() | |
bool | IsActive [get] |
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.
Definition at line 28 of file DetectorLogicGate.cs.
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.
Definition at line 93 of file DetectorLogicGate.cs.
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.
Detector | the detector to watch. |
Definition at line 67 of file DetectorLogicGate.cs.
|
protected |
Checks all the observed detectors, combines them with the specified type of logic and calls the Activate() or Deactivate() function as appropriate.
Definition at line 131 of file DetectorLogicGate.cs.
void Leap.Unity.DetectorLogicGate.RemoveDetector | ( | Detector | detector | ) |
Removes the specified detector from the list of observed detectors;
Detector | the detector to remove. |
Definition at line 80 of file DetectorLogicGate.cs.
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.
Definition at line 44 of file DetectorLogicGate.cs.
LogicType Leap.Unity.DetectorLogicGate.GateType = LogicType.AndGate |
The type of logic for this gate: AND or OR.
Definition at line 51 of file DetectorLogicGate.cs.
bool Leap.Unity.DetectorLogicGate.Negate = false |
Whether to negate the output of the gate. AND becomes NAND; OR becomes NOR.
Definition at line 58 of file DetectorLogicGate.cs.