/// <summary> /// 跳跃 /// </summary> /// <param name="jumpForce">跳跃力</param> /// <param name="up"></param> private void goToJump(float jumpForce, bool up = true) { //limit if (ExtraJumpCount >= 0) { Rbody2D.AddForce(new Vector2(0, jumpForce * (up ? 1 : -1))); } }
// 跳跃 public override void jump() { base.jump(); if (OnGround == true) { OnGround = false; Rbody2D.AddForce(new Vector2(0, JumpForce), ForceMode2D.Force); print("LadyD jump:" + Physics2D.gravity.y); IsJumping = true; } }