예제 #1
0
        private bool m_loopOverride;  // Will the override continue until a new one is set?


        public CharacterRig()
        {
            CurrentAnimation = new RigAnimation();
            Animations       = new Dictionary <string, RigAnimation>();
            Bones            = new List <Bone>();
            Scale            = new Vector2(1.0f);
        }
예제 #2
0
 public RigAnimation(RigAnimation original)
 {
     Id        = original.Id;
     RigFrames = new List <RigFrame>();
     foreach (RigFrame rig in original.RigFrames)
     {
         RigFrames.Add(rig.Copy());
     }
     Loop = original.Loop;
     Over = original.Over;
 }
예제 #3
0
 public CharacterRig(Entity owner, string id, List <string> tags, Bone root, Dictionary <string, RigAnimation> animations) : base(owner, id, tags, true, false)
 {
     CurrentAnimation = new RigAnimation();
     Animations       = new Dictionary <string, RigAnimation>();
     Bones            = new List <Bone>();
     Scale            = new Vector2(1.0f);
     Root             = root;
     Animations       = animations;
     CurrentAnimation = Animations.First().Value;
     PreviousFrame    = CurrentAnimation.RigFrames[0];
 }
예제 #4
0
 public CharacterRig(Entity owner, CharacterRig original) : base(owner, original.Id, original.Tags, original.Active)
 {
     Animations = new Dictionary <string, RigAnimation>();
     foreach (KeyValuePair <string, RigAnimation> anim in original.Animations)
     {
         Animations.Add(anim.Key, anim.Value.Copy());
     }
     CurrentAnimation = original.CurrentAnimation.Copy();
     Bones            = new List <Bone>();
     Tags             = original.Tags;
     Scale            = original.Scale;
     Rotation         = original.Rotation;
     Root             = original.Root.Copy();
     PreviousFrame    = CurrentAnimation.RigFrames[0].Copy();
     OverridePosition = new Vector2(0);
     MountId          = original.MountId;
 }
예제 #5
0
 public void SwitchToAnim(string id, bool smooth = true)
 {
     if (smooth)
     {
         PreviousFrame    = new RigFrame(Bones, Position, 0);
         CurrentAnimation = Animations[id];
         NextFrame        = 0;
         m_frameTime      = 0;
     }
     else
     {
         CurrentAnimation = Animations[id];
         PreviousFrame    = CurrentAnimation.RigFrames[0];
         NextFrame        = 1;
         m_frameTime      = 0;
     }
     CurrentAnimation.Over = false;
 }