LogicIntThresholdReceiver
A class in Root.Township, Alta.Logic.
Logic receiver that outputs true while an int input is above a threshold (or below, if set). Runs on the server and saves its threshold.
Constructors
| Member | What it is |
|---|
LogicIntThresholdReceiver() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private bool currentValue | Last output value. |
private bool isActiveAboveThreshold | True to output true above the threshold, false for below. |
private BoolUnityEvent onValueUpdated | Unity event fired with the new output. |
private int threshold | The value compared against. |
Methods
| Member | What it is |
|---|
override void InitializeAsServer(SpawnData spawnData) | Server: works out the starting value and fires onValueUpdated with it. |
protected override void ValueUpdated() | When the input changes, fires onValueUpdated if the result changed. |
1 private and internal method
| Member | What it is |
|---|
private bool GetValue() | Compares the input to the threshold, strictly above or strictly below depending on isActiveAboveThreshold. |