Example #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));
     }
 }
Example #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);
     }
 }
Example #3
0
 private void FixedUpdate()
 {
     if (!attacking)
     {
         efd.SetOnGroundVelocity(speed);
     }
     else
     {
         rigid.SetVelocity(0f, 0f);
     }
 }
Example #4
0
 private void FixedUpdate()
 {
     if (efd.OnGround)
     {
         efd.SetOnGroundVelocity(currentSpeed);
     }
     else
     {
         rigid.SetVelocity(0, 0);
     }
 }
Example #5
0
 void FixedUpdate()
 {
     efd.SetOnGroundVelocity(currentSpeed);
 }