Ejemplo n.º 1
0
            public void LookCalculator_GetNewLookAngle_Returns_Angle_Increased_By_Speed()
            {
                var lookCalculator = new LookCalculator();

                var newAngle = lookCalculator.GetNewLookAngle(Vector2.down.y, 0, 10, 1.0f);

                Assert.AreEqual(10, newAngle);
            }
Ejemplo n.º 2
0
            public void LookCalculator_GetNewLookAngle_Returns_Minimum_Of_Neg_45_When_Looking_Up()
            {
                var lookCalculator = new LookCalculator();

                var newAngle = lookCalculator.GetNewLookAngle(Vector2.up.y, -45, 10, 0.1f);

                Assert.AreEqual(-45, newAngle);
            }
Ejemplo n.º 3
0
            public void LookCalculator_GetNewLookAngle_Returns_Maximum_Of_45_When_Looking_Down()
            {
                var lookCalculator = new LookCalculator();

                var newAngle = lookCalculator.GetNewLookAngle(Vector2.down.y, 45, 10, 0.1f);

                Assert.AreEqual(45, newAngle);
            }
Ejemplo n.º 4
0
    private void UpDown()
    {
        if (!_lookCalculator.HasLookInput(_lookInput))
        {
            return;
        }

        _lookAngle = _lookCalculator.GetNewLookAngle(_lookInput.y, _lookAngle, lookSpeed, Time.deltaTime);

        _camera.transform.localEulerAngles = _lookCalculator.GetNewLookRotation(_lookAngle);
    }