When I want to load another scene and show my loading screen to the user - my loading screen is a game object holding a canvas, I use coroutines, but when I type something like this: LoadingScreen.Show ();
Application.LoadLevel ("PlayerMenu");
Loading screen is shown less than a second, so I wanted to use coroutines, I typed this:
IEnumerator LoadLevel(string levelName) {
LoadingScreen.Show ();
yield return new WaitForSeconds (2f);
Application.LoadLevel (levelName);
}
The problem when calling the coroutine is that my LoadingScreen.Show() code is not executed, so basically I'm just waiting 2 seconds looking at the background of my current scene and then it goes to another scene, I'm confused here as to what is going on, shouldn't my LoadingScreen.Show() code be executed and then I would see the loading screen and wait 2 seconds and the next scene will appear. Anyone has an idea?