public void AddAnimation(string id, FramesManager frames) { if (!_animations.ContainsKey(id)) { _animations.Add(id, frames); } }
public override void Update() { base.Update(); if (_nextAnimation != CurrentAnimationId) { _currentAnimation = _animations[_nextAnimation]; Texture = _currentAnimation.CurrentFrame.Texture; TextureOffset = _currentAnimation.CurrentFrame.TextureOffset; TextureClip = _currentAnimation.CurrentFrame.TextureClip; } if (_currentAnimation.IsNotNull()) { _currentAnimation.Update(); if (_currentAnimation.Changed) { Texture = _currentAnimation.CurrentFrame.Texture; TextureOffset = _currentAnimation.CurrentFrame.TextureOffset; TextureClip = _currentAnimation.CurrentFrame.TextureClip; } } }