Skip to main content

InvokeEvent

A class in Root.Township, the global namespace.

Holds a list of Unity events and invokes one by index, unless turned off.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private UnityEvent[] eventsThe events to pick from.
private bool isEnabledBacking field for IsEnabled.

Properties​

MemberWhat it is
bool IsEnabled { get; set; }When false, Invoke does nothing.

Methods​

MemberWhat it is
void Invoke(int index)Fires the event at that index in the list, if this component is enabled.