Example #1
0
    public void btnProxima()
    {
        NumQuestao++;
        x++;
        posicao++;

        if (err == 1)
        {
            HP05.SetActive(false);
        }

        if (err == 2)
        {
            HP04.SetActive(false);
        }

        if (err == 3)
        {
            HP03.SetActive(false);
        }

        if (err == 4)
        {
            HP02.SetActive(false);
        }

        if (err >= 5)
        {
            HP01.SetActive(false);
            NumQuestao = 21;
        }

        if (NumQuestao == 2)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();

            Subnivel = 2;

            Mapa01.SetActive(true);
            Mapa01B.SetActive(false);
        }
        if (NumQuestao == 3)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();

            Mapa01.SetActive(true);
            Mapa01B.SetActive(false);
        }
        if (NumQuestao == 4)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();

            Mapa01.SetActive(true);
            Mapa01B.SetActive(false);
        }
        if (NumQuestao == 5)
        {
            ConsultarIds();

            Debug.Log("Nivel 6 - Pos:" + x + " = " + idQuestão);

            PainelMeio1.SetActive(true);

            ZerarInimigos();
            ZerarBarcos();

            Mapa01.SetActive(false);
            Mapa01B.SetActive(false);

            Mapa02.SetActive(true);

            x = 0;

            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);
        }
        if (NumQuestao == 6)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();

            Subnivel = 3;

            Mapa02.SetActive(true);
            Mapa02B.SetActive(false);
        }
        if (NumQuestao == 7)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();

            Mapa02.SetActive(true);
            Mapa02B.SetActive(false);
        }
        if (NumQuestao == 8)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();

            Mapa02.SetActive(true);
            Mapa02B.SetActive(false);
        }
        if (NumQuestao == 9)
        {
            ConsultarIds();

            Debug.Log("Nivel 6 - Pos:" + x + " = " + idQuestão);

            PainelMeio2.SetActive(true);

            ZerarInimigos();
            ZerarBarcos();

            Mapa02.SetActive(false);
            Mapa02B.SetActive(false);

            Mapa03.SetActive(true);

            x = 0;

            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);
        }
        if (NumQuestao > 9 && NumQuestao < 13)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();
            DesativarRadarInimigo();

            Subnivel = 4;

            Mapa03.SetActive(true);
            Mapa03B.SetActive(false);
        }
        if (NumQuestao == 13)
        {
            ConsultarIds();

            Debug.Log("Nivel 6 - Pos:" + x + " = " + idQuestão);

            PainelMeio3.SetActive(true);

            ZerarInimigos();
            ZerarBarcos();

            Mapa03.SetActive(false);
            Mapa03B.SetActive(false);

            Mapa04.SetActive(true);

            x = 0;

            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);
        }
        if (NumQuestao > 13 && NumQuestao < 17)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();
            DesativarRadarInimigo();

            Subnivel = 5;

            Mapa04.SetActive(true);
            Mapa04B.SetActive(false);
        }
        if (NumQuestao == 17)
        {
            ConsultarIds();

            Debug.Log("Nivel 6 - Pos:" + x + " = " + idQuestão);

            PainelMeio4.SetActive(true);

            ZerarInimigos();
            ZerarBarcos();

            Mapa04.SetActive(false);
            Mapa04B.SetActive(false);

            Mapa05.SetActive(true);

            x = 0;

            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);
        }
        if (NumQuestao > 17 && NumQuestao <= 20)
        {
            idQuestão = ids[x];
            Debug.Log("Nivel 6 - subnivel " + Subnivel + "- Pos:" + x + " = " + idQuestão);

            ChamarQuestao();

            ZerarInimigos();
            ZerarBarcos();

            DesativarRadarBarcos();
            DesativarRadarInimigo();

            Mapa05.SetActive(true);
            Mapa05B.SetActive(false);
        }

        if (NumQuestao > 20)
        {
            AcertosFinal.text = Acertos.ToString();

            PainelFinal.SetActive(true);
            if (Acertos > 14)
            {
                Aprovado.SetActive(true);

                Pontos          = Acertos * 10;
                Pontos          = DBManager.score + Pontos;
                DBManager.score = Pontos;

                if (DBManager.nivel <= Nivel)
                {
                    gravarComNivel();
                }
                else
                {
                    gravarSemNivel();
                }
            }
            else
            {
                Reprovado.SetActive(true);
            }
        }

        DesativarRadarInimigo();

        NumeroQuestao.text         = NumQuestao.ToString();
        TxtQtdQuestoesRespond.text = NumQuestao.ToString();

        PainelResposta.SetActive(false);
        Correto.SetActive(false);
        Incorreto.SetActive(false);
    }
Example #2
0
    public void DesativarRadarMapas()
    {
        //Nivel01
        if (posicao == 1)
        {
            Mapa01.SetActive(true);
            Mapa01B.SetActive(false);
        }
        if (posicao == 2)
        {
            Mapa01.SetActive(true);
            Mapa01B.SetActive(false);
        }
        if (posicao == 3)
        {
            Mapa01.SetActive(true);
            Mapa01B.SetActive(false);
        }
        if (posicao == 4)
        {
            Mapa01.SetActive(true);
            Mapa01B.SetActive(false);
        }

        //Nivel02
        if (posicao == 5)
        {
            Mapa02.SetActive(true);
            Mapa02B.SetActive(false);
        }
        if (posicao == 6)
        {
            Mapa02.SetActive(true);
            Mapa02B.SetActive(false);
        }
        if (posicao == 7)
        {
            Mapa02.SetActive(true);
            Mapa02B.SetActive(false);
        }
        if (posicao == 8)
        {
            Mapa02.SetActive(true);
            Mapa02B.SetActive(false);
        }

        //Nivel03
        if (posicao == 9)
        {
            Mapa03.SetActive(true);
            Mapa03B.SetActive(false);
        }
        if (posicao == 10)
        {
            Mapa03.SetActive(true);
            Mapa03B.SetActive(false);
        }
        if (posicao == 11)
        {
            Mapa03.SetActive(true);
            Mapa03B.SetActive(false);
        }
        if (posicao == 12)
        {
            Mapa03.SetActive(true);
            Mapa03B.SetActive(false);
        }

        //Nivel04
        if (posicao > 12 && posicao <= 16)
        {
            Mapa04.SetActive(true);
            Mapa04B.SetActive(false);
        }

        //Nivel05
        if (posicao > 16)
        {
            Mapa05.SetActive(true);
            Mapa05B.SetActive(false);
        }
    }