File size: 838 Bytes
18a519f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | using System.Collections;
namespace Unity.VisualScripting
{
[UnitCategory("Time")]
public abstract class WaitUnit : Unit
{
/// <summary>
/// The moment at which to start the delay.
/// </summary>
[DoNotSerialize]
[PortLabelHidden]
public ControlInput enter { get; private set; }
/// <summary>
/// The action to execute after the delay has elapsed.
/// </summary>
[DoNotSerialize]
[PortLabelHidden]
public ControlOutput exit { get; private set; }
protected override void Definition()
{
enter = ControlInputCoroutine(nameof(enter), Await);
exit = ControlOutput(nameof(exit));
Succession(enter, exit);
}
protected abstract IEnumerator Await(Flow flow);
}
}
|