I’ve problem with waiting, even in coding. I need my game to wait like 5 seconds (public int would be awesome) before Application.LoadLevel(0); so player can cry for few secs before starting again. So far the code looks like
if(Data.ReturnPlayerHealth() <= 0)
{
Awake();
Data.ChangePlayerHealth(100);
Destroy(this.gameObject);
}
IEnumerator Awake()
{
yield return new WaitForSeconds(5);
Application.LoadLevel(0);
}
Doesn’t work and I’ve no idea where it went wrong.