IEnumerator ShowEndingCoroutine() { m_BGMPlayer.PlayWalkingAmbient(m_PhoneScript.Score); yield return(m_CinematicScript.ActivateCinematicEffectCoroutine(true)); m_HUD.SetActive(false); m_GirlfriendMeetingPanel.SetActive(true); SetupMessageMural(); m_Player.GetComponent <AudioSource> ().Play(); m_Player.GetComponent <Animator> ().SetBool("Walking", true); // TODO: probably will need to find a way to loop the footsteps SFX, since a separate BGM will be playing alongside. //m_AudioSource.PlayOneShot (m_PlayerFootstepsClip); iTween.FadeTo(m_CameraFadePanel, 0f, m_CameraFadeDuration); yield return(new WaitForSeconds(m_CameraFadeDuration + 2f)); for (int i = 0; i < numMessagesDisplayed; i++) { iTween.MoveTo(m_MessagePairs[i], iTween.Hash("position", m_MessagePairMoveToPosition, "time", m_MessagePairMoveToDuration, "easetype", iTween.EaseType.linear)); yield return(new WaitForSeconds(m_MessagePairMoveToDuration / 2f)); } if (!m_PhoneScript.HasAtLeastTwoReplies) { yield return(new WaitForSeconds((m_MessagePairMoveToDuration / 2f) * (m_MaxMessagesToDisplay + 1))); } else { yield return(new WaitForSeconds(m_MessagePairMoveToDuration / 2f)); } m_BGMPlayer.FadeOutWalkingAmbient(); iTween.MoveTo(m_Girlfriend, iTween.Hash("position", m_GFMoveToPosition, "time", m_GFMoveToDuration, "easetype", iTween.EaseType.linear)); yield return(new WaitForSeconds(m_GFMoveToDuration)); m_WalkingBackground.GetComponent <Animator> ().enabled = false; m_Player.GetComponent <AudioSource> ().Stop(); m_Player.GetComponent <Animator> ().SetTrigger("MessagesStop"); // stop the player's walking yield return(new WaitForSeconds(1f)); yield return(EmulateDialogueCoroutine()); }