private void FixedUpdate() { _horizontalInput = GetHorizontalInput(); if (AnyKeyFrom(_jumpKeys, Input.GetKey)) { PlayerTryJump(_horizontalInput); } else { PlayerTryMove(_horizontalInput); } }
private void PlayerTryJump(HorizontalInput horizontalInput) { if (horizontalInput == HorizontalInput.None) { _player.TryJumpUp(); } else if (horizontalInput == HorizontalInput.Left) { _player.TryJumpForward(false); } else { _player.TryJumpForward(true); } }
private void PlayerTryMove(HorizontalInput horizontalInput) { if (horizontalInput == HorizontalInput.None) { _player.TrySlowdown(); } else if (horizontalInput == HorizontalInput.Left) { _player.TryMoveForward(false); } else { _player.TryMoveForward(true); } }