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;
        }
Exemple #2
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;
        }
Exemple #3
0
 /// <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));
 }