Example #1
0
            public void LookCalculator_HasTurnInput_Returns_True_When_X_Above_0()
            {
                var lookCalculator = new LookCalculator();

                var hasTurnInput = lookCalculator.HasTurnInput(Vector2.right);

                Assert.IsTrue(hasTurnInput);
            }
Example #2
0
            public void LookCalculator_HasTurnInput_Returns_False_When_X_Is_0()
            {
                var lookCalculator = new LookCalculator();

                var hasTurnInput = lookCalculator.HasTurnInput(Vector2.zero);

                Assert.IsFalse(hasTurnInput);
            }
Example #3
0
    private void Turn()
    {
        if (!_lookCalculator.HasTurnInput(_lookInput))
        {
            return;
        }

        transform.Rotate(Vector3.up * (_lookInput.x * Time.deltaTime * lookSpeed));
    }