Exemple #1
0
        /// <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;
        }