void CheckUpgradeButtonBudget(UpgradeButtonBehaviour button, WeaponUpgradableAttributes.WeaponAttribute upgrade) { if (PlayerStats.Money < upgrade.upgradeCurrentPrice) { button.gameObject.GetComponent <Button>().interactable = false; } else { button.gameObject.GetComponent <Button>().interactable = true; } }
private bool HaveBudgetForUpgrade(WeaponUpgradableAttributes.WeaponAttribute upgrade) { var upgradePrice = upgrade.upgradeCurrentPrice; if (PlayerStats.Money < upgradePrice) { Debug.Log("Not enough money!"); return(false); } gameManager.playerStatsScript.UpdateMoney(upgradePrice * -1); return(true); }
public void RefreshUI(WeaponUpgradableAttributes.WeaponAttribute weaponAttribute) { level.text = "Lv " + weaponAttribute.level.ToString(); price.text = "$" + weaponAttribute.upgradeCurrentPrice.ToString(); }