Skip to main content

LogicSumFloatReceiver

A class in Root.Township, Alta.Logic.

Logic receiver that adds up any number of float inputs and outputs the total. Runs on the server and saves its inputs.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private float currentValueLast total sent.
private FloatUnityEvent onValueUpdatedUnity event fired with the new total.

Methods​

MemberWhat it is
override void InitializeAsServer(SpawnData spawnData)Server: works out the starting total and fires onValueUpdated with it.
protected override void ValueUpdated()When an input changes, fires onValueUpdated if the total changed.
1 private and internal method
MemberWhat it is
private float GetValue()Adds up all input values.