Skip to main content

OneTimeUnityEvent

A class in Root.Township, the global namespace.

Component wrapping an AltaEvent that only fires once until ResetEvent is called. Wire Invoke up from other events in the inspector.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private bool isInvokedTrue once the event has fired. Not saved, so it resets when the object is reloaded.
private AltaEvent unityEventThe event that fires on the first Invoke.

Methods​

MemberWhat it is
void Invoke()Fires the event the first time only; later calls do nothing until ResetEvent.
void ResetEvent()Clears the fired flag so the next Invoke runs the event again.