protected override IEnumerator TeleportEnd() { if (FadeToBlack) { if (TeleportCamera) { LevelManager.Instance.LevelCameraController.FollowsPlayer = false; } MMEventManager.TriggerEvent(new MMFadeInEvent(FadeDuration)); yield return(new WaitForSeconds(FadeDuration)); if (TeleportCamera) { LevelManager.Instance.LevelCameraController.TeleportCameraToTarget(); LevelManager.Instance.LevelCameraController.FollowsPlayer = true; } MMEventManager.TriggerEvent(new MMFadeOutEvent(FadeDuration)); } else { if (TeleportCamera) { LevelManager.Instance.LevelCameraController.TeleportCameraToTarget(); } } yield return(new WaitForSeconds(TimeWithoutControl)); _character.UnFreeze(); //mutes the 'touch the ground' sfx for a second lucyHorizontalMovement.JustTeleported(); //Moving the parallax root position to the new room cameraLocation = Camera.main.transform.position; var ParallaxClass = FindObjectOfType <ProCamera2DParallax>(); if (ParallaxClass != null) { ParallaxClass.RootPosition = cameraLocation; } //fade back after the player has hit the ground StartCoroutine(HitTheGroundThenFadeOut()); //Start the boss room cinematic if (bossOpeningCinematic != null) { StartCoroutine(bossOpeningCinematic.BossCinematic()); } }
protected virtual IEnumerator TeleportEnd() { if (FadeToBlack) { if (TeleportCamera) { LevelManager.Instance.LevelCameraController.FollowsPlayer = false; } MMEventManager.TriggerEvent(new MMFadeInEvent(FadeDuration)); yield return(new WaitForSeconds(FadeDuration)); if (TeleportCamera) { LevelManager.Instance.LevelCameraController.TeleportCameraToTarget(); LevelManager.Instance.LevelCameraController.FollowsPlayer = true; } TurnRoomsOffAndOnAsAppropriate(); MMEventManager.TriggerEvent(new MMFadeOutEvent(FadeDuration)); } else { if (TeleportCamera) { LevelManager.Instance.LevelCameraController.TeleportCameraToTarget(); } } yield return(new WaitForSeconds(TimeWithoutControl)); _player.UnFreeze(); if (lucyHorizontalMovement != null) { lucyHorizontalMovement.JustTeleported(); } //Moving the parallax root position to the new room cameraLocation = Camera.main.transform.position; var ParallaxClass = FindObjectOfType <ProCamera2DParallax>(); if (ParallaxClass != null) { ParallaxClass.RootPosition = cameraLocation; } StartCoroutine(HitTheGroundThenFadeOut()); }