/// <summary> /// ici tente de jumper /// </summary> public void TryToJump() { if (!playerJump.CanJump()) { return; } //grip.ResetGrip(); if (!worldCollision.IsGroundedSafe() && !worldCollision.IsGroundeExeptionSafe()) { //Debug.Log("ici jump double"); AirJump(); } else { /*if (worldCollision.IsGroundeExeptionSafe() && playerManager.AreBothNotGrounded()) * { * Debug.Log("si les 2 joueurs sont en l'air, ne pas sauter !"); * return; * }*/ //Debug.Log("ici jump sumple"); SimpleJump(); } }
public void Jump() { if (isCrouching) { ToggleCrouch(); } else if (playerJump.CanJump() && !playerAim.IsAiming) { var force = playerJump.IsGrounded() ? jumpForce : airJumpForce; rigidBody.AddForce(transform.up * force, ForceMode.Impulse); playerJump.Jump(); animator.SetTrigger(PlayerAnimationTags.JUMP_TRIGGER); AudioManager.Instance.PlayJumpAudio(transform.position); } }