Exemplo n.º 1
0
 public IEnumerator CoGameWin()
 {
     gameState = eGameState.gameOver;
     if (MadLevel.HasNext())
     {
         uiManager.goBtnGameNext.SetActive(true);
     }
     uiManager.goImgGameWin.SetActive(true);
     uiManager.goBtnGameRestart.SetActive(true);
     uiManager.goBtnGameBack.SetActive(true);
     yield return(null);
 }
Exemplo n.º 2
0
    IEnumerator WaitForAnimation()
    {
        yield return(new WaitForSeconds(2.2f)); // animation lasts 2 second

        if (completed)
        {
            // if level is completed go to next level or to 'Level Select'
            // depends of it this the last level
            if (MadLevel.HasNext(MadLevel.Type.Level))
            {
                MadLevel.LoadNext(MadLevel.Type.Level);
            }
            else
            {
                MadLevel.LoadLevelByName("Level Select");
            }
        }
        else
        {
            // if not completed go back to the menu
            MadLevel.LoadLevelByName("Level Select");
        }
    }