예제 #1
0
 public void AddAnimation(string id, FramesManager frames)
 {
     if (!_animations.ContainsKey(id))
     {
         _animations.Add(id, frames);
     }
 }
예제 #2
0
        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;
                }
            }
        }