private void CheckCash(string action) { if (action == Constantes.UPGRADE) { if (PlayerGlobalStatus.getPlayerCash() >= upgradeCurrentPrice) { if (PlayerHaveItem() || !item.CompareTag(Constantes.WEAPON)) { globalPanel.GetComponent <PurchaseStatusPanelManager>().OptionManager(gameObject, action); } else { globalPanel.GetComponent <PurchaseStatusPanelManager>().NoWeaponText(); } } else { globalPanel.GetComponent <PurchaseStatusPanelManager>().NoCashText(upgradeCurrentPrice, action); } } //comprar else { if (PlayerGlobalStatus.getPlayerCash() >= itemPrice) { globalPanel.GetComponent <PurchaseStatusPanelManager>().OptionManager(gameObject, action); } else { globalPanel.GetComponent <PurchaseStatusPanelManager>().NoCashText(itemPrice, action); } } }
public void NoCashText(float itemPrice, string action) { EnablePurchaseStatusPanel(); SetUpgradeInfoPanel(false); SetCancelButtonVisibility(false); SetPanelAtributes(true, false); string keyWord; if (action == Constantes.UPGRADE) { keyWord = "UPGRADE PRICE:"; } else { keyWord = "ITEM PRICE:"; } string preco = (itemPrice).ToString("C2"); string playerCash = PlayerGlobalStatus.getPlayerCash().ToString("C2"); string texto = string.Format(purchaseTexts[0].ToString() + keyWord + " {0}\nYOU HAVE: {1}", preco, playerCash); textReference.text = texto; }
public void UpdateScoreText() { cashText.text = "CASH: " + PlayerGlobalStatus.getPlayerCash().ToString("0.00"); }
//PLAYER STATUS UI( HEALTH, CASH, CHANCES ): private void setScoreAndVidaText() { cashText.text = "CASH: " + PlayerGlobalStatus.getPlayerCash().ToString("0.00"); chancesText.text = "CHANCES: " + PlayerGlobalStatus.getPlayerChances().ToString(); }
private void UpdateCash() { GameObject cashPanel = transform.Find(Constantes.CASH_PANEL).gameObject; cashPanel.GetComponentInChildren <TextMeshProUGUI>().text = Constantes.CASH + "\n" + PlayerGlobalStatus.getPlayerCash().ToString("C2"); }