/// <summary> /// Display game over panel and /// all the animations and components inside /// the panel. /// </summary> /// <returns>IEnumerator</returns> public IEnumerator DisplayGameOver() { this.displayed = true; // update values. yield return(new WaitForSeconds(.1f)); dataPanel.UpdateValues(score.text, hours.text, minutes.text, seconds.text); // display screen cover. screenCover.gameObject.SetActive(true); screenCover.Display(); yield return(new WaitForSeconds(.2f)); // display game over title. StartCoroutine(titleWrapper.DisplayTitleAnimation()); yield return(new WaitForSeconds(1f)); // display data panel components. StartCoroutine(dataPanel.DisplayElements()); yield return(new WaitForSeconds(.5f)); // display buttons. playAgainButton.Display(); yield return(new WaitForSeconds(.1f)); mainMenuButton.Display(); }