CarpMuffin.Animations.Animation.Update C# (CSharp) Method

Update() public method

public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void
        public void Update(GameTime gameTime)
        {
            _elapsed += gameTime.ElapsedGameTime.TotalMilliseconds;

            if (_elapsed > FrameLength)
            {
                CurrentIndex++;
                _elapsed -= FrameLength;
            }

            if (CurrentIndex >= Frames.Count) CurrentIndex = 0;
        }