void Update() { transform.Rotate(PlayerRotation.CalculateYRotation(_playerMovementInput.GetAxis("Mouse X"), _playerMovementInput.GetDeltaTime())); characterController.Move(PlayerGroundMovement.Calculate(_playerMovementInput.GetAxis("Horizontal"), _playerMovementInput.GetAxis("Vertical"), _playerMovementInput.GetDeltaTime())); characterController.Move(PlayerVerticalMovement.CalculateGravitationalEffectVector(_playerMovementInput.GetDeltaTime())); }
public void CalculateShouldReturnExpectedVector3() { var player = new GameObject().AddComponent <PlayerController>(); PlayerGroundMovement playerGroundMovement = new PlayerGroundMovement(player.transform, 12f); Vector3 expected = new Vector3(12f, 0f, 12f); Assert.AreEqual(expected, playerGroundMovement.Calculate(1f, 1f, 1f)); }