Exemplo n.º 1
0
    IEnumerator ChangeLevel(int level)
    {
        FaderScript fader = GameObject.Find("MenuScriptsHolder").GetComponent <FaderScript>();
        float       wait  = fader.BeginFade(1);

        yield return(new WaitForSeconds(wait));

        Application.LoadLevel(level);
    }
Exemplo n.º 2
0
    IEnumerator ChangeLevel(int levelNum)
    {
        //call screen fade
        FaderScript fdrs   = GetComponent <FaderScript>();
        float       result = fdrs.BeginFade(1);

        yield return(new WaitForSeconds(result));

        //load level number
        SceneManager.LoadScene(levelNum);
    }