Esempio n. 1
0
 public void Kill(bool shouldFileCompleteEvent = true)
 {
     if (IsRunning)
     {
         IsRunning = false;
         if (shouldFileCompleteEvent)
         {
             OnInterpolationComplete?.Invoke(this);
         }
     }
 }
Esempio n. 2
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if (IsRunning)
            {
                switch (_interpolationType)
                {
                case AeInterpolationType.OneShot:
                    _currentTime += gameTime.ElapsedGameTime.Milliseconds;
                    if (_currentTime >= CurrentTarget)
                    {
                        IsRunning = false;
                        OnInterpolationComplete?.Invoke(this);
                    }
                    break;

                case AeInterpolationType.TriangleWave:
                    if (_isTimerIncreasing)
                    {
                        _currentTime += gameTime.ElapsedGameTime.Milliseconds;
                    }
                    else
                    {
                        _currentTime -= gameTime.ElapsedGameTime.Milliseconds;
                    }

                    if (_currentTime >= CurrentTarget)
                    {
                        _currentTime       = CurrentTarget;
                        _isTimerIncreasing = false;
                    }
                    if (_currentTime <= 0)
                    {
                        _currentTime       = 0;
                        _isTimerIncreasing = true;
                    }

                    OnInterpolationComplete?.Invoke(this);
                    break;

                default:
                    break;
                }
            }
        }