Skip to main content

LogicFloatRangeReceiver

A class in Root.Township, Alta.Logic.

Logic receiver that outputs true while a float input is strictly between a minimum and maximum (or outside it, if set). Runs on the server and saves its range.

Constructors​

MemberWhat it is
LogicFloatRangeReceiver()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

5 private and internal fields
MemberWhat it is
private bool currentValueLast output value.
private bool isActiveWithinRangeTrue to output true inside the range, false to output true outside it.
private float maximumValueUpper bound (exclusive).
private float minimumValueLower bound (exclusive).
private BoolUnityEvent onValueUpdatedUnity event fired with the new output.

Methods​

MemberWhat 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
MemberWhat it is
private bool GetValue()Checks whether the input is strictly between the bounds, inverted if isActiveWithinRange is off.