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); }
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); }
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); }
private void UpDown() { if (!_lookCalculator.HasLookInput(_lookInput)) { return; } _lookAngle = _lookCalculator.GetNewLookAngle(_lookInput.y, _lookAngle, lookSpeed, Time.deltaTime); _camera.transform.localEulerAngles = _lookCalculator.GetNewLookRotation(_lookAngle); }