Пример #1
0
    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 CalculateYRotationShouldReturnExpectedRotation()
        {
            float          mouseX    = 10f;
            float          deltaTime = 10f;
            PlayerRotation player    = new PlayerRotation(10f);
            Vector3        expected  = new Vector3(0.0f, 1000f, 0.0f);

            Assert.AreEqual(expected, player.CalculateYRotation(mouseX, deltaTime));
        }