using System.Collections; namespace Unity.VisualScripting { [UnitCategory("Time")] public abstract class WaitUnit : Unit { /// /// The moment at which to start the delay. /// [DoNotSerialize] [PortLabelHidden] public ControlInput enter { get; private set; } /// /// The action to execute after the delay has elapsed. /// [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); } }