Exemple #1
0
 public void ResetVariaveis()
 {
     contandoPonto = false;
     pontuacaoCanvas.SetActive(false);
     ingredientesCanvas.SetActive(false);
     receitaCanvas.SetActive(false);
     dicasCanvas.SetActive(true);
     stateGame         = StateGameSingle.DISCASFASE;
     actualIngrediente = 0;
     ingredienteCount  = 0;
     pontuacao         = 300;
     countStars        = 0;
     dicasLiberadas    = 0;
 }
Exemple #2
0
    public void InputButtonGame(int indiceButton)
    {
        //if (!TutorialScript.onTuto)
        //{
        changeTexts = true;

        if (stateGame == StateGameSingle.DISCASFASE)
        {
            if (indiceButton < 4)
            {
                if (indiceButton > dicasLiberadas || indiceButton == 3 && dicasLiberadas == 3)
                {
                    dicasLiberadas++;
                }
            }
            else if (indiceButton == 4)
            {
                stateGame = StateGameSingle.INGREDIENTEFASE;
            }
            else if (indiceButton == 5)
            {
                actualIngrediente++;
                dicasLiberadas = 0;
            }
            else if (indiceButton == 6)
            {
                if (actualIngrediente > 0)
                {
                    actualIngrediente--;
                    dicasLiberadas = 0;
                }
            }
        }
        else if (stateGame == StateGameSingle.INGREDIENTEFASE)
        {
            if (indiceButton == correctButtonIngre)
            {
                if (lastIngre == true)
                {
                    //gameObject.SendMessage("AdiviVisit");
                    stateGame         = StateGameSingle.RECEITAFASE;
                    actualIngrediente = 0;
                    return;
                }
                else
                {
                    correctButtonIngre = (int)Random.Range(0, 4);
                    stateGame          = StateGameSingle.DISCASFASE;
                    dicasLiberadas     = 0;
                    actualIngrediente++;
                    if (actualIngrediente == actualReceita.Ingredientes.Length - 1)
                    {
                        lastIngre = true;
                    }
                    return;
                }
            }
            else if (indiceButton < 4)
            {
                print("Errou");
                return;
            }

            if (indiceButton == 4)
            {
                correctButtonIngre = Random.Range(0, 4);
                stateGame          = StateGameSingle.DISCASFASE;
                return;
            }

            if (actualIngrediente >= actualReceita.Ingredientes.Length - 1)
            {
                correctButtonIngre = Random.Range(0, 4);
                stateGame          = StateGameSingle.RECEITAFASE;
                actualIngrediente  = 0;
            }
            else
            {
                actualIngrediente++;
                if (actualIngrediente > ingredienteCount)
                {
                    ingredienteCount++;
                }
            }
        }
        else
        {
            if (stateGame == StateGameSingle.RECEITAFASE)
            {
                if (indiceButton == correctButton)
                {
                    if (PlayerPrefs.GetString("PaisAtual") == "Brasil")
                    {
                        if (currentRecipe == 0)
                        {
                            NPCSlot.sprite = Vaca1;
                        }
                        else
                        {
                            NPCSlot.sprite = Vaca2;
                        }
                    }
                    else if (PlayerPrefs.GetString("PaisAtual") == "Mexico")
                    {
                        if (currentRecipe == 0)
                        {
                            NPCSlot.sprite = Mexico1;
                        }
                        else
                        {
                            NPCSlot.sprite = Mexico2;
                        }
                    }
                    if (PlayerPrefs.GetInt("Personagem") == 2)
                    {
                        if (currentRecipe == 0)
                        {
                            PlayerSlot.sprite = Calopsita1;
                        }
                        else
                        {
                            PlayerSlot.sprite = Calopsita2;
                        }
                    }
                    else
                    {
                        if (currentRecipe == 0)
                        {
                            PlayerSlot.sprite = Gato1;
                        }
                        else
                        {
                            PlayerSlot.sprite = Gato2;
                        }
                    }
                    stateGame = StateGameSingle.PONTUACAOFASE;
                }
                else
                {
                    if (indiceButton < 4)
                    {
                        pontuacao -= 50;
                    }
                }

                if (indiceButton == 4)
                {
                    stateGame         = StateGameSingle.INGREDIENTEFASE;
                    actualIngrediente = actualReceita.Ingredientes.Length - 1;
                }
            }
        }
    }