예제 #1
0
    void CheckAnswer()
    {
        if (cypher.CheckAnswer(answerInput.text))
        {
            NivelAtual = NivelAtual + 1;
            if (NivelAtual == 1)
            {
                PlacarStar.sprite = Star01;
            }
            if (NivelAtual == 2)
            {
                PlacarStar.sprite = Star02;
            }
            if (NivelAtual == 3)
            {
                PlacarStar.sprite = Star03;
            }

            if (NivelAtual <= 2)
            {
                var nextCypher = cypher.GetNextCypher();

                if (nextCypher != null)
                {
                    answerInput.text = "";
                    var time = scriptCounter.GetComponent <CountTime>().GetTime();
                    times.Add(time);
                    scriptCounter.GetComponent <CountTime>().Reset();
                    SetCypher(nextCypher);

                    /*     if (EditorUtility.DisplayDialog("Parabéns!", "Você conseguiu decifrar a mensagem! Clique em Ok para ir ao próximo desafio", "Ok"))
                     *  {
                     *      answerInput.text = "";
                     *      var time = scriptCounter.GetComponent<CountTime>().GetTime();
                     *      times.Add(time);
                     *      scriptCounter.GetComponent<CountTime>().Reset();
                     *      SetCypher(nextCypher);
                     *  }
                     */
                }
            }
            if (NivelAtual >= 3)
            {
                EndGame();
            }
        }
        else
        {
            //EditorUtility.DisplayDialog("Falha!", "Não foi dessa vez! Mas não desista, clique em Ok para continuar tentando", "Ok");
        }
    }