I am using as coroutine so that something happens 2 seconds after another few things.
IEnumerator MyMethod()
{
Debug.Log ("Dead");
Destroy (PlayerSprite);
yield return new WaitForSeconds(2.0f);
Application.Loadlevel("Level 1")
Debug.Log("Loading level?");
}
Want I want this to do is send ‘dead’ and such, wait 2 seconds, and then reload the level with Application.LoadLevel. I call the coroutine later like this:
StartCoroutine(MyMethod());
The Debug.Log(“Dead”); is sent and everything before, but nothing after the 2 seconds happens, including the second Debug.Log! Anyone know what part I’m phrasing incorrectly? - JS