15 [Tooltip(
"A set of events to execute together")]
20 [Tooltip(
"A set of events to execute together")]
25 [NonSerialized]
private UnityEvent
nextEvent =
null;
27 public FlipFlop(UnityAction firstAction, UnityAction secondAction)
29 UnityEvent firstEventConstructor =
new UnityEvent();
30 firstEventConstructor.AddListener(firstAction);
32 UnityEvent secondEventConstructor =
new UnityEvent();
33 secondEventConstructor.AddListener(secondAction);
35 this.firstEvent = firstEventConstructor;
36 this.secondEvent = secondEventConstructor;
Allows you to alternate between the execution of two events with each call of the Invoke method.
void Invoke()
Invokes the firstEvent or the secondEvent alternating.
FlipFlop(UnityAction firstAction, UnityAction secondAction)
UnityEvent firstEvent
A set of events to execute together.
UnityEvent secondEvent
A set of events to execute together.
UnityEvent nextEvent
The next UnityEvent to be executed. If null, firstEvent is going to be executed next .
FlipFlop(UnityEvent firstEvent, UnityEvent secondEvent)