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
| Member | What it is |
|---|
OneTimeUnityEvent() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private bool isInvoked | True once the event has fired. Not saved, so it resets when the object is reloaded. |
private AltaEvent unityEvent | The event that fires on the first Invoke. |
Methods
| Member | What 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. |