Ejemplo n.º 1
0
 public void DilmaPartidoOff()
 {
     MeuPartido.Remove(Dilma);
     DilmaPartido.SetActive(false);
     DilmaDentroPartido = 0;
     PlayerPrefs.SetInt("DilmaDentroPartido", DilmaDentroPartido);
     PlayerPrefs.SetInt("DilmaComprado", 1);
 }
Ejemplo n.º 2
0
    //  --------------------- DILMA -------------------- //

    public void DilmaPartidoOn()
    {
        int precoDilma    = 200;
        int dilmaComprado = 0;

        if (PlayerPrefs.GetInt("Verba") >= precoDilma)
        {
            PlayerPrefs.SetInt("PodeComprarDilma", 1);
        }

        if (PlayerPrefs.GetInt("PodeComprarDilma") == 1)

        {
            if (MeuPartido.Count < 4 && PlayerPrefs.GetInt("DilmaComprado") == 0)
            {
                PlayerPrefs.SetInt("Verba", (PlayerPrefs.GetInt("Verba") - precoDilma));
                dilmaComprado = 1;
                PlayerPrefs.SetInt("DilmaComprado", dilmaComprado);
            }
            if (MeuPartido.Count >= 4)
            {
                print("O partido pode contar apenas 4 políticos.");
            }
        }

        if (PlayerPrefs.GetInt("DilmaComprado") == 1)
        {
            precoDilma = 0;

            if (MeuPartido.Count < 4)
            {
                DilmaPartido.SetActive(true);
                DilmaDentroPartido = 1;
                PlayerPrefs.SetInt("DilmaDentroPartido", DilmaDentroPartido);

                if (!MeuPartido.Contains(Dilma))
                {
                    MeuPartido.Add(Dilma);
                }
            }
        }
    }