示例#1
0
 void Jump()
 {
     if (!objPlayer.isGrounded())
     {
         if (objRope.getTimeToJump())
         {
             objPlayer.JumpWithDog();
             counter++;
         }
     }
 }
示例#2
0
 void Jump()
 {
     if (grounded && !gameOver)
     {
         SwitchJumpAnimation();
         GetComponent <Rigidbody2D> ().velocity = new Vector2(GetComponent <Rigidbody2D> ().velocity.x, 0);
         GetComponent <Rigidbody2D> ().AddForce(new Vector2(0, jumpForce));
         candoublejump = true;
         grounded      = false;
         if (objRope.getTimeToJump())
         {
             jumps++;
         }
         PlayJumpSound();
     }
     if (gameOver)
     {
         RestartGame();
     }
 }