Exemplo n.º 1
0
 public void CiroPartidoOff()
 {
     MeuPartido.Remove(Ciro);
     CiroPartido.SetActive(false);
     CiroDentroPartido = 0;
     PlayerPrefs.SetInt("CiroDentroPartido", CiroDentroPartido);
     PlayerPrefs.SetInt("CiroComprado", 1);
 }
Exemplo n.º 2
0
    // ------------------------------------------------------------------ //

    // ---------------------------- CIRO ----------------------------------- //

    public void CiroPartidoOn()
    {
        int precoCiro    = 200;
        int ciroComprado = 0;

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

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

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

        if (PlayerPrefs.GetInt("CiroComprado") == 1)
        {
            precoCiro = 0;

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

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