public static T OnUpdating <T>(this T coroutine, Action onUpdating)
where T : AwaitableCoroutineBase
{
if (coroutine is null)
{
ThrowHelper.ArgNull(nameof(coroutine));
}
if (onUpdating is null)
{
ThrowHelper.ArgNull(nameof(onUpdating));
}
if (coroutine.IsCanceled)
{
ThrowHelper.InvalidOp("Coroutine is already canceled");
}
if (coroutine.IsCompleted)
{
ThrowHelper.InvalidOp("Coroutine is already completed");
}
coroutine.OnUpdating += onUpdating;
return(coroutine);
}