Exemplo n.º 1
0
    public void Update()
    {
        if (gameOn || StaticMinigame3Controller.getReplay() == true)
        {
            roundTime -= Time.deltaTime;

            if (roundTime > 0)
            {
                time.text  = "" + (int)roundTime;
                score.text = "" + scoreNumber;
            }
            else
            {
                gameEnd();
            }

            if (inventory.transform.childCount == 0)
            {
                setReplayFalse();
                gameOn = true;
                StaticCheckGame.setGameEndedTrue();
                if (StaticCheckGame.getSlotsChecked() == 5)
                {
                    if (StaticCheckGame.getGameWin() == false)
                    {
                        wrong.gameObject.SetActive(true);
                        correct.gameObject.SetActive(false);
                        gameOn = false;
                        StartCoroutine(nextRound());
                    }
                    else
                    {
                        correct.gameObject.SetActive(true);
                        wrong.gameObject.SetActive(false);
                        scoreNumber++;
                        gameOn = false;
                        StartCoroutine(nextRound());
                    }
                }
            }
        }
    }