public bool buyOrSell = true;//true is Buy, false is Sell void Awake() { money.text = playerStats.getMoney().ToString(); username.text = playerStats.username; yes.gameObject.SetActive(false); no.gameObject.SetActive(false); confirmation.gameObject.SetActive(false); if (buying.gameObject.activeSelf) { buyOrSell = true; } else { buyOrSell = false; } }
// Update is called once per frame void Update() { if (tamanho == 0) { tamanho = scroll._pageCount; precos = new float[scroll._pageCount]; nome = new string[scroll._pageCount]; carPosition = scroll._currentPage; precos[0] = 0; nome[0] = "Goal 93'"; PlayerPrefs.SetString("car" + carPosition + "Posse", "true"); precos[1] = 3200; nome[1] = "Carro2"; precos[2] = 16500; nome[2] = "Carro3"; precos[3] = 50000; nome[3] = "Carro4"; valorText.text = "R$ " + precos[(int)carPosition].ToString() + ",00"; nomeText.text = nome[(int)carPosition]; } if (playerStats.getMoney() >= precos[(int)carPosition] && PlayerPrefs.GetString("car" + carPosition + "Posse") != "true") { comprarBtn.interactable = true; } else { comprarBtn.interactable = false; } }
void Update() { moneytxt.text = "R$ " + playerStats.getMoney().ToString(); exptxt.text = playerStats.getExp().ToString(); }