Esempio n. 1
0
    private IEnumerator GameOverSequence()
    {
        // Reveal bombs
        foreach (GameObject b in bombs)
        {
            Cell c = b.GetComponent <Cell>();
            c.Open(false);
            yield return(new WaitForSeconds(0.2f));
        }
        yield return(new WaitForSeconds(0.5f));

        // Reveal all cells
        for (int x = 0; x < gridSize.x; x++)
        {
            for (int y = 0; y < gridSize.y; y++)
            {
                Cell c = cells[y][x].GetComponent <Cell>();
                c.Open(false);
            }
        }
        yield return(new WaitForSeconds(0.5f));

        // Instantiate Dialog
        GameObject          go         = Instantiate(endGameDialog, canvas.transform) as GameObject;
        EndDialogController controller = go.GetComponent <EndDialogController>();

        // Stop if something went wrong (it's problably not going to do this)
        if (controller != null)
        {
            // Initialize the dialog
            controller.Initialize("Não foi dessa vez!", currentTime, Restart, ReturnToMenu);
        }
    }
Esempio n. 2
0
    private void Win()
    {
        // Changes game state
        state = State.Won;

        // Instantiate Dialog
        GameObject          go         = Instantiate(endGameDialog, canvas.transform) as GameObject;
        EndDialogController controller = go.GetComponent <EndDialogController>();

        // Stop if something went wrong (it's problably not going to do this)
        if (controller == null)
        {
            return;
        }

        // Initialize the dialog
        controller.Initialize("Você ganhou o jogo!", currentTime, Restart, ReturnToMenu);
    }