public void GetCurrentMoney() { fakeExp = LojaController.GetComponent <LojaConstroller>().expfake; currentMoneyV = LojaController.GetComponent <LojaConstroller>().currentMoney; currentCashV.GetComponent <TextMesh> ().text = currentMoneyV.ToString(); AtualCash.GetComponent <TextMesh> ().text = currentMoneyV.ToString(); }
public void BP6() { if (QuanItem6V < LojaController.GetComponent <LojaConstroller> ().Citem6) { QuanItem6V += 1; atualizaItens(itemText6V, QuanItem6V); LastItemChoose = "item6"; ItemDescricao(LastItemChoose); } }
public void BP3() { if (QuanItem3V < LojaController.GetComponent <LojaConstroller> ().Citem2) { QuanItem3V += 1; atualizaItens(itemText3V, QuanItem3V); LastItemChoose = "item3"; ItemDescricao(LastItemChoose); } }
public void Vender() { if (totalPayV > 0) { currentMoneyV += totalPayV; LojaController.GetComponent <LojaConstroller>().currentMoney = currentMoneyV; LojaController.GetComponent <LojaConstroller> ().Citem1 -= QuanItem1V; LojaController.GetComponent <LojaConstroller> ().Citem2 -= QuanItem2V; LojaController.GetComponent <LojaConstroller> ().Citem3 -= QuanItem3V; LojaController.GetComponent <LojaConstroller> ().Citem4 -= QuanItem4V; LojaController.GetComponent <LojaConstroller> ().Citem5 -= QuanItem5V; LojaController.GetComponent <LojaConstroller> ().Citem6 -= QuanItem6V; playerSafe = new PlayerP(fakeExp, currentMoneyV); playerJson = JsonMapper.ToJson(playerSafe); File.WriteAllText((Application.persistentDataPath + "/Player.json"), playerJson.ToString()); saveMaterial = new Materiais(LojaController.GetComponent <LojaConstroller> ().Citem1, LojaController.GetComponent <LojaConstroller> ().Citem2, LojaController.GetComponent <LojaConstroller> ().Citem3, LojaController.GetComponent <LojaConstroller> ().Citem4, LojaController.GetComponent <LojaConstroller> ().Citem5, LojaController.GetComponent <LojaConstroller> ().Citem6); playerJson = JsonMapper.ToJson(saveMaterial); File.WriteAllText((Application.persistentDataPath + "/Materiais.json"), playerJson.ToString()); currentCashV.GetComponent <TextMesh> ().text = currentMoneyV.ToString(); AtualCash.GetComponent <TextMesh> ().text = currentMoneyV.ToString(); ZeraItens(); ValorGastar(); currentMoneyV = LojaController.GetComponent <LojaConstroller>().currentMoney; } else { LojaController.GetComponent <LojaConstroller> ().warnning2(); } }
public void Comprar() { if (totalPay <= currentMoney) { currentMoney -= totalPay; LojaController.GetComponent <LojaConstroller>().currentMoney = currentMoney; LojaController.GetComponent <LojaConstroller> ().Pitem1 += QuanItem1; LojaController.GetComponent <LojaConstroller> ().Pitem2 += QuanItem2; LojaController.GetComponent <LojaConstroller> ().Pitem3 += QuanItem3; LojaController.GetComponent <LojaConstroller> ().Pitem4 += QuanItem4; LojaController.GetComponent <LojaConstroller> ().Pitem5 += QuanItem5; LojaController.GetComponent <LojaConstroller> ().Pitem6 += QuanItem6; playerSafe = new PlayerP(fakeExp, currentMoney); playerJson = JsonMapper.ToJson(playerSafe); File.WriteAllText((Application.persistentDataPath + "/Player.json"), playerJson.ToString()); saveItens = new Itens(LojaController.GetComponent <LojaConstroller> ().Pitem1 , LojaController.GetComponent <LojaConstroller> ().Pitem2 , LojaController.GetComponent <LojaConstroller> ().Pitem3 , LojaController.GetComponent <LojaConstroller> ().Pitem4 , LojaController.GetComponent <LojaConstroller> ().Pitem5 , LojaController.GetComponent <LojaConstroller> ().Pitem6); playerJson = JsonMapper.ToJson(saveItens); File.WriteAllText((Application.persistentDataPath + "/Materiais.json"), playerJson.ToString()); currentCash.GetComponent <TextMesh> ().text = currentMoney.ToString(); AtualCash.GetComponent <TextMesh> ().text = currentMoney.ToString(); ZeraItens(); ValorGastar(); } else { LojaController.GetComponent <LojaConstroller> ().warnning(); } }