Esempio n. 1
0
 private void FixedUpdate()
 {
     if (!jumping)
     {
         if (idleShooting)
         {
             rigid.SetVelocity(0f, 0f);
         }
         else
         {
             if (pDetect.detected)
             {
                 efd.SetOnGroundVelocity(horizontalVelocity * 1.2f);
             }
             else
             {
                 efd.SetOnGroundVelocity(speed);
             }
         }
     }
     else
     {
         rigid.AddForce(new Vector2(horizontalSpeed * efd.dir, jumpForce * ascend));
     }
 }
Esempio n. 2
0
 private void FixedUpdate()
 {
     if (!detected && !prepared)
     {
         efd.SetOnGroundVelocity(currentSpeed);
     }
     else if (detected && !prepared)
     {
         rigid.velocity = new Vector2(0f, rigid.velocity.y);
     }
     else if (prepared)
     {
         efd.SetOnGroundVelocity(currentSpeed * 1.5f);
     }
 }
Esempio n. 3
0
 private void FixedUpdate()
 {
     if (!attacking)
     {
         efd.SetOnGroundVelocity(speed);
     }
     else
     {
         rigid.SetVelocity(0f, 0f);
     }
 }
Esempio n. 4
0
 private void FixedUpdate()
 {
     if (efd.OnGround)
     {
         efd.SetOnGroundVelocity(currentSpeed);
     }
     else
     {
         rigid.SetVelocity(0, 0);
     }
 }
Esempio n. 5
0
 void FixedUpdate()
 {
     efd.SetOnGroundVelocity(currentSpeed);
 }