When I complete the level, it must show 'Level Completed!" text and wait for 5 seconds then start next level.
private void showSuccess() {
levelCompleted.SetActive (true);
StartCoroutine("waitForNextLevel");
}
IEnumerator waitForNextLevel() {
Debug.Log ("Start time: " + Time.time);
yield return new WaitForSeconds (5);
Debug.Log ("End time: " + Time.time);
prepareTheLevel ();
}
However, the text appears successfully, the game waits for 5 seconds, and the text dissappears. Then it waits another 5 seconds and start the next level.
I want it wait only 5 seconds without hiding the text.
Any ideas?