private void OnEnable() { if ((inputProvider == null) || (settings == null)) { return; } UpdateOperatingHeightRange(); UpdateOperatingTiltRange(); UpdateTiltFactor(); if (settings.UseDynamicFieldOfView) { float t = operatingHeightRange.InverseLerp(CurrentHeight); camera.fieldOfView = settings.DynamicFieldOfViewRange.Lerp(settings.EvaluateFieldOfViewTransition(t)); } if (monitorTiltAngleHandle == null) { monitorTiltAngleHandle = StartCoroutine(RoutineMonitorTilt()); } if (dynamicFieldOfViewHandle == null) { dynamicFieldOfViewHandle = StartCoroutine(RoutineMonitorFieldOfView()); } }
private void UpdateTiltFactor() { tiltFactor = operatingTiltRange.InverseLerp(CurrentTiltAngle); }