internal void Initialize()
        {
            _LimbAnimations = new LimbAnimationState[LimbAnimations.Length];

            for (int j = 0; j < _LimbAnimations.Length; j++)
            {
                _LimbAnimations[j] = new LimbAnimationState(LimbAnimations[j]);
            }
        }
示例#2
0
        internal void Initialize()
        {
            animationTime = TimeSpan.FromSeconds(AnimationTime);

            _LimbAnimations = new LimbAnimationState[LimbAnimations.Length];

            for (int j = 0; j < _LimbAnimations.Length; j++)
            {
                _LimbAnimations[j] = new LimbAnimationState(LimbAnimations[j]);
            }
        }
示例#3
0
        internal void Update(SpriteEffects effect)
        {
            if (currentTime < maxTime)
            {
                currentTime += Common.ElapsedTimeDelta;

                for (int i = 0; i < animations; i++)
                {
                    LimbAnimationState state = currentAnimations[i];
                    state.Update(effect);

                    currentAnimations[i] = state;
                }
            }
            else
            if (OnFinished != null)
            {
                OnFinished("");
            }
        }
        internal void Update(SpriteEffects effect)
        {
            if (playing)
            {
                currentTime += Common.ElapsedTimeDelta;

                if (currentTime < AnimationTime)
                {
                    for (int i = 0; i < _LimbAnimations.Length; i++)
                    {
                        LimbAnimationState state = _LimbAnimations[i];
                        state.Update(effect);

                        _LimbAnimations[i] = state;
                    }
                }
                else
                if (OnFinished != null)
                {
                    OnFinished(Name);
                }
            }
        }
示例#5
0
        LimbAnimationState CreateKeyFrame(int index)
        {
            LimbKeyFrameCollection frames = new LimbKeyFrameCollection();

            int totalFrames = (int)(prevAnimations[index].Animation.FrameRate / maxTime.TotalSeconds) + 1;

            LimbKeyFrame frame1 = prevAnimations[index].Animation[prevAnimations[index].Animation.Count - 1];

            frame1.FrameNumber = 0;

            LimbKeyFrame frame2 = nextAnimations[index].Animation[0];

            frame2.FrameNumber = totalFrames;

            frames.AddFrame(frame1);
            frames.AddFrame(frame2);

            frames.LimbName  = prevAnimations[index].LimbName;
            frames.FrameRate = (float)TimeSpan.FromSeconds(maxTime.TotalSeconds / totalFrames).TotalSeconds;

            LimbAnimationState frame = new LimbAnimationState(frames);

            return(frame);
        }