IEnumerator EndCinematicRoutine() { if (_letterbox != null && LetterboxAmount > 0) { _letterbox.TweenTo(0f, LetterboxAnimDuration); } var initialPosH = Vector3H(_newPos); var initialPosV = Vector3V(_newPos); var currentCameraSize = ProCamera2D.ScreenSizeInWorldCoordinates.y * .5f; // _TurnRateEase out var t = 0f; while (t <= 1.0f) { if (!_paused) { t += ProCamera2D.DeltaTime / EndDuration; float newPosH = 0f; float newPosV = 0f; if (ProCamera2D.CameraTargets.Count > 0) { newPosH = Utils.EaseFromTo(initialPosH, Vector3H(_originalPos), t, EndEaseType); newPosV = Utils.EaseFromTo(initialPosV, Vector3V(_originalPos), t, EndEaseType); } else { newPosH = Utils.EaseFromTo(initialPosH, Vector3H(_startPos), t, EndEaseType); newPosV = Utils.EaseFromTo(initialPosV, Vector3V(_startPos), t, EndEaseType); } if (UseNumericBoundaries) { LimitToNumericBoundaries(ref newPosH, ref newPosV); } _newPos = VectorHVD(newPosH, newPosV, 0); _newSize = Utils.EaseFromTo(currentCameraSize, _initialCameraSize, t, EndEaseType); } yield return(ProCamera2D.GetYield()); } if (OnCinematicFinished != null) { OnCinematicFinished.Invoke(); } _isPlaying = false; // Ugly hack... but no way around it at the moment if (ProCamera2D.CameraTargets.Count == 0) { ProCamera2D.Reset(true); } }