Skip to main content

FrequencyLimiter

A class in Root.Township, the global namespace.

Passes an event on at most once per interval. Call Invoke as often as you like.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private AltaEvent invokedEvent fired when Invoke is allowed through.
private float minimumIntervalSeconds before it can fire again. Default 10.
private float nextInvokeTime after which the next call will fire.

Methods​

MemberWhat it is
void Invoke()Fires invoked unless it already fired within the last minimumInterval seconds.