Beispiel #1
0
        public void AnimBasicAnimation(Vector2 pMovement)
        {
            if (pMovement == Vector2.Zero)
            {
                mModel.SetAnimation();
                return;
            }
            string  TmpAnimation;
            Vector2 TmpMovement = pMovement;

            TmpMovement.Normalize();
            //Flip?
            if (TmpMovement.X > 0)
            {
                mModel.Flip = true;
            }
            else if (TmpMovement.X < 0)
            {
                mModel.Flip = false;
            }
            //Get correct Animation
            //if (TmpMovement.Y > Math.Sin(67.5)) //Hoch
            //	TmpAnimation = "walkUp";
            //else if (TmpMovement.Y > Math.Sin(22.5)) //Seitlich hoch
            //	TmpAnimation = "walkSideUp";
            //else if (TmpMovement.Y > -Math.Sin(22.5)) //Seitlich
            //	TmpAnimation = "walkSide";
            //else if (TmpMovement.Y > -Math.Sin(67.5)) //Seitlich runter
            //	TmpAnimation = "walkSideDown";
            //else //Runter
            //	TmpAnimation = "WalkDown";
            TmpAnimation = "idle";
            mModel.SetAnimation(TmpAnimation);
        }
Beispiel #2
0
 //Start Animation
 public static void StartAnimation(SpineObject pSpine, string pAnimation, bool pLoop = false)
 {
     pSpine.SetAnimation(pAnimation, pLoop, true);
 }