コード例 #1
0
 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;
     }
 }
コード例 #2
0
    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);
    }
コード例 #3
0
 public void RefreshUI(WeaponUpgradableAttributes.WeaponAttribute weaponAttribute)
 {
     level.text = "Lv " + weaponAttribute.level.ToString();
     price.text = "$" + weaponAttribute.upgradeCurrentPrice.ToString();
 }