public void Update(GameTime gameTime)
        {
            if (State != AnimatorState.Animating)
            {
                return;
            }

            _timer.Update(gameTime);

            foreach (var colorType in _colorTypes)
            {
                var startingColor = ColorSetPair.Starting.Get(colorType);
                var endingColor   = ColorSetPair.Ending.Get(colorType);
                var nextColor     = Color.Lerp(
                    startingColor,
                    endingColor,
                    _timer.Progress);

                Colors.Set(colorType, nextColor);
            }

            if (_timer.Finished)
            {
                State = AnimatorState.Finished;
            }
        }
Пример #2
0
 public static void Update(GameTime gameTime)
 {
     if (_transitioning)
     {
         Animator.Update(gameTime);
         if (Animator.State != AnimatorState.Finished)
         {
             return;
         }
         TransitionPairs.Next();
         Animator.ColorSetPair = TransitionPairs.GetCurrent();
         Animator.Reset();
         _transitioning = false;
     }
     else
     {
         WaitingTimer.Update(gameTime);
         if (!WaitingTimer.Finished)
         {
             return;
         }
         WaitingTimer.Reset();
         _transitioning = true;
     }
 }