private bool PlayerHasEnoughVerticalSpaceToGetUp() { var currentHeightToStandUprightHeightDelta = PlayerController.StandIdleEnvironmentBoxColliderSize.y - PlayerController.EnvironmentBoxCollider.size.y; return(CharacterPhysicsManager.CanMoveVertically(currentHeightToStandUprightHeightDelta)); }
protected virtual bool CanJump() { if (!CharacterPhysicsManager.CanMoveVertically( VERTICAL_COLLISION_FUDGE_FACTOR, (PlayerController.PlayerState & PlayerState.Crouching) == 0)) { // if we crouch we don't allow edge slide up to simplify things return(false); } return(PlayerController.IsGrounded() || Time.time - PlayerController.CharacterPhysicsManager.LastMoveCalculationResult.CollisionState.LastTimeGrounded < PlayerController.JumpSettings.AllowJumpAfterGroundLostThreashold); }