public void Animate() { if (_currentFrame > _currentStage.EndFrame) { if (_currentStage.Loop) { _currentFrame = _currentStage.StartFrame; } else if (_currentStage.NextStageAfterComplete) { NextStage(); } else if (_currentStage.DestroyAfterComplete) { Timers.Remove(_timer); } else { return; } } _displayRect.X = _displayRect.Width * (_currentFrame % _cols); _displayRect.Y = _displayRect.Height * (_currentFrame / _cols); _parent._srcRect = _displayRect; _currentFrame++; }
public void Remove() { Timers.Remove(_timerIndex); _parent = null; }