public void Convert() { if (ConvertedCoin > 0) { itensController.ouro -= ConvertGoldNumber; itensController.ferro -= ConvertIronNumber; itensController.bronze -= ConvertBronzeNumber; itensController.uranio -= ConvertUranioNumber; itensController.coin += ConvertedCoin; ConvertBronzeNumber = 0; ConvertIronNumber = 0; ConvertUranioNumber = 0; ConvertGoldNumber = 0; ConvertedCoin = 0; ConvertUranioTXT.text = ConvertUranioNumber.ToString(); ConvertGoldTXT.text = ConvertGoldNumber.ToString(); ConvertIronTXT.text = ConvertIronNumber.ToString(); ConvertBronzeTXT.text = ConvertBronzeNumber.ToString(); ReceivedCoinTXT.text = ConvertedCoin.ToString(); HUDItens.SetActive(true); GoldScript.AttGold(); HUDItens.SetActive(false); } }
public void ShowCambio() { //Mudar a LAYER DOS TEXTS CurrentUranioTXT.GetComponent <Renderer>().sortingOrder = 200; CurrentGoldTXT.GetComponent <Renderer>().sortingOrder = 200; CurrentIronTXT.GetComponent <Renderer>().sortingOrder = 200; CurrentBronzeTXT.GetComponent <Renderer>().sortingOrder = 200; ConvertUranioTXT.GetComponent <Renderer>().sortingOrder = 200; ConvertGoldTXT.GetComponent <Renderer>().sortingOrder = 200; ConvertIronTXT.GetComponent <Renderer>().sortingOrder = 200; ConvertBronzeTXT.GetComponent <Renderer>().sortingOrder = 200; ReceivedCoinTXT.GetComponent <Renderer>().sortingOrder = 200; //================== //Setar os valores dos TEXTS CurrentUranioTXT.text = itensController.uranio.ToString(); CurrentGoldTXT.text = itensController.ouro.ToString(); CurrentIronTXT.text = itensController.ferro.ToString(); CurrentBronzeTXT.text = itensController.bronze.ToString(); ConvertBronzeNumber = 0; ConvertIronNumber = 0; ConvertUranioNumber = 0; ConvertGoldNumber = 0; ConvertedCoin = 0; ConvertUranioTXT.text = ConvertUranioNumber.ToString(); ConvertGoldTXT.text = ConvertGoldNumber.ToString(); ConvertIronTXT.text = ConvertIronNumber.ToString(); ConvertBronzeTXT.text = ConvertBronzeNumber.ToString(); cambioAnimator.SetBool("Trigger", true); HUDItens.SetActive(false); }
public void HideCambio() { ConvertBronzeNumber = 0; ConvertIronNumber = 0; ConvertUranioNumber = 0; ConvertGoldNumber = 0; ConvertedCoin = 0; ConvertUranioTXT.text = ConvertUranioNumber.ToString(); ConvertGoldTXT.text = ConvertGoldNumber.ToString(); ConvertIronTXT.text = ConvertIronNumber.ToString(); ConvertBronzeTXT.text = ConvertBronzeNumber.ToString(); ReceivedCoinTXT.text = ConvertedCoin.ToString(); cambioAnimator.SetBool("Trigger", false); HUDItens.SetActive(true); }
public void AttMinusPlus(GameObject button) { //OURO if (button.gameObject.name == "plusGOLD" && ConvertGoldNumber < itensController.ouro) { ConvertGoldNumber++; ConvertGoldTXT.text = ConvertGoldNumber.ToString(); ConvertedCoin += 10; ReceivedCoinTXT.text = ConvertedCoin.ToString(); } else if (button.gameObject.name == "minusGOLD" && ConvertGoldNumber > 0) { ConvertGoldNumber--; ConvertGoldTXT.text = ConvertGoldNumber.ToString(); ConvertedCoin -= 10; ReceivedCoinTXT.text = ConvertedCoin.ToString(); } //BRONZE if (button.gameObject.name == "plusBRONZE" && ConvertBronzeNumber < itensController.bronze) { ConvertBronzeNumber++; ConvertBronzeTXT.text = ConvertBronzeNumber.ToString(); ConvertedCoin += 1; ReceivedCoinTXT.text = ConvertedCoin.ToString(); } else if (button.gameObject.name == "minusBRONZE" && ConvertBronzeNumber > 0) { ConvertBronzeNumber--; ConvertBronzeTXT.text = ConvertBronzeNumber.ToString(); ConvertedCoin -= 1; ReceivedCoinTXT.text = ConvertedCoin.ToString(); } //FERRO if (button.gameObject.name == "plusIRON" && ConvertIronNumber < itensController.ferro) { ConvertIronNumber++; ConvertIronTXT.text = ConvertIronNumber.ToString(); ConvertedCoin += 2; ReceivedCoinTXT.text = ConvertedCoin.ToString(); } else if (button.gameObject.name == "minusIRON" && ConvertIronNumber > 0) { ConvertIronNumber--; ConvertIronTXT.text = ConvertIronNumber.ToString(); ConvertedCoin -= 2; ReceivedCoinTXT.text = ConvertedCoin.ToString(); } //URANIO if (button.gameObject.name == "plusURANIO" && ConvertUranioNumber < itensController.uranio) { ConvertUranioNumber++; ConvertUranioTXT.text = ConvertUranioNumber.ToString(); ConvertedCoin += 100; ReceivedCoinTXT.text = ConvertedCoin.ToString(); } else if (button.gameObject.name == "minusURANIO" && ConvertUranioNumber > 0) { ConvertUranioNumber--; ConvertUranioTXT.text = ConvertUranioNumber.ToString(); ConvertedCoin -= 100; ReceivedCoinTXT.text = ConvertedCoin.ToString(); } }