Example #1
0
        public void AddAnimation(string name, SceneAnimation a)
        {
            //Dont Accept Empty Animations
            if (a.KeyFrames.Count == 0)
            {
                return;
            }

            if (a.KeyFrames.Count == 1)
            {
                if (a.AnimationType == SceneAnimationType.FullRepeat || a.AnimationType == SceneAnimationType.SetRepeat)
                {
                    return;
                }
            }

            if (!Animations.ContainsKey(name))
            {
                Animations.Add(name, a);
            }
            else
            {
                Animations[name] = a;
            }
        }
Example #2
0
 private void EndAnimation()
 {
     _keyFrame                 = 0;
     _currentFrame             = 0;
     _currentAnimationKeyFrame = null;
     _cycles = 0;
     AnimationQueue.Clear();
     _keyAdvancementForward = true;
     _currentAnimation      = null;
 }
Example #3
0
        public void Play(string v)
        {
            if (!Animations.ContainsKey(v))
            {
                return;
            }
            if (State == AnimationState.Playing || State == AnimationState.Paused)
            {
                ResetState();
            }
            _currentAnimation = Animations[v];

            //Dangerous, List could be empty
            NewKey(_currentAnimation.KeyFrames[0]);

            State = AnimationState.Playing;
        }