protected virtual void UpdateAnimation(UpdateData data) { _animationTimeout -= data.GameTime.ElapsedGameTime.Milliseconds; if (_animationTimeout < 0) { if (!Looping) { if (_frame == _animation.Length() - 1) { _frame = (int)MathHelper.Clamp(_frame, 0, _animation.Length() - 1); if (AnimationCompleteEvent != null) { AnimationCompleteEvent(this, new EventArgs()); } return; } } _frame = (_frame + 1) % _animation.Length(); _animationTimeout = _animation.FrameTime; } }