void Start() { cameraRotations = GetComponentInChildren <Camera>().GetComponent <CameraRotations>(); Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; isPaused = false; }
/// <summary> /// Rotate the camera /// </summary> /// <param name="rot"></param> /// <param name="angle">Angle in radians</param> public void Rotate(CameraRotations rot, float angle) { switch (rot) { case CameraRotations.YawLeft: Yaw(-angle); break; case CameraRotations.YawRight: Yaw(angle); break; case CameraRotations.PitchUp: Pitch(-angle); break; case CameraRotations.PitchDown: Pitch(angle); break; case CameraRotations.RollClockwise: Roll(angle); break; case CameraRotations.RollAntiClockwise: Roll(-angle); break; default: break; } }