예제 #1
0
파일: track.cs 프로젝트: zfedoran/helium
 //////////////////////////////////////////////////////////////////////////
 // CONSTRUCTORS
 //////////////////////////////////////////////////////////////////////////
 //-----------------------------------------------------------------------
 public AnimationTrack(string name, Animation parent)
 {
     this.name = name;
     this.parent = parent;
     maxFrameTime = 0;
     keyframes = new List<AnimationKeyFrame>();
 }
예제 #2
0
        private static Animation CreateAnimation(SerializableAnimation animationContent)
        {
            Animation animation = new Animation(animationContent.name);
            animation.SetLength(animationContent.length);

            foreach (SerializableTrack trackContent in animationContent.tracks)
            {
                AnimationTrack track = animation.CreateTrack(trackContent.name);

                for (int i = 0; i < trackContent.keyframes.Count; i++)
                {
                    SerializableKeyFrame keyFrameContent = trackContent.keyframes[i];
                    AnimationKeyFrame keyFrame = new AnimationKeyFrame
                    {
                        rotation = keyFrameContent.rotation,
                        scale = keyFrameContent.scale,
                        translation = keyFrameContent.translation,
                        time = keyFrameContent.time
                    };

                    track.AddKeyFrame(keyFrame);
                }
            }

            return animation;
        }
예제 #3
0
파일: state.cs 프로젝트: zfedoran/helium
        //////////////////////////////////////////////////////////////////////////
        // CONSTRUCTORS
        //////////////////////////////////////////////////////////////////////////
        //-----------------------------------------------------------------------
        public AnimationState(Animation animation)
        {
            this.animation = animation;

            length = animation.GetLength();
            curr_position = 0;
            weight = 1;
            speed = 1.0f;
            curr_position = 0;
            prev_position = 0;

            looping = false;
            paused = false;
            active = false;

            fade_step = 0;
        }
예제 #4
0
파일: model.cs 프로젝트: zfedoran/helium
 //-----------------------------------------------------------------------
 public void AddAnimation(Animation animation)
 {
     animationList.Add(animation);
     animationIndexByName.Add(animation.GetName(), animationList.Count - 1);
 }