/// <summary> /// Do next iteration. /// </summary> /// <param name="gameTime"></param> internal void Update(IGameTime gameTime) { if (_done) { return; } if (_wait != null) { _wait.Update(gameTime); if (!_wait.IsOver) { return; } _wait = null; } if (!_coroutine.MoveNext()) { _done = true; _whenDone?.Invoke(this); return; } _wait = _coroutine.Current as CoroutineWait; }
/// <summary> /// Do next iteration. /// </summary> /// <param name="gameTime"></param> internal void Update(IGameTime gameTime) { if (_done) return; if (_wait != null) { _wait.Update(gameTime); if (!_wait.IsOver) return; _wait = null; } if (!_coroutine.MoveNext()) { _done = true; _whenDone?.Invoke(this); return; } _wait = _coroutine.Current as CoroutineWait; }
/// <summary> /// Use with Coroutine to instruct the coroutine to wait at least a /// given amount of milleseconds before the next entry. /// </summary> /// <param name="amount"></param> /// <returns></returns> protected object WaitMSecs(int amount) { return(CoroutineWait.WaitMilleseconds(amount)); }