Skip to main content

LogicFloatReset

A class in Root.Township, Alta.Logic.

Logic component that passes a float through to its sender and, once nobody is interacting, eases it back to a default value after a delay. Saves its values.

Constructors​

MemberWhat it is
LogicFloatReset()Creates a LogicFloatReset with default values.

Fields​

8 private and internal fields
MemberWhat it is
private float currentTimerTime waited before returning starts.
private float defaultValueValue it returns to.
private bool errorMessagePostedStops the missing-sender warning from repeating.
private bool isInteractingWhether a player is interacting.
private float returnSpeedPerSecHow fast the value returns, per second.
private LogicFloatSender senderFloat sender the value is output on.
private float targetValueCurrent value being sent.
private float timeBeforeReturnSeconds to wait before returning.

Methods​

MemberWhat it is
void IsInteracting(bool value)Sets whether a player is holding the control, which pauses the return.
void Update()When not interacting and the delay has passed, moves the value toward defaultValue at returnSpeedPerSec and sends it.
void UpdateValue(float value)Sets and sends a new value, restarting the delay if someone is interacting.
1 private and internal method
MemberWhat it is
private void Awake()Resets the missing-sender warning flag.