Beispiel #1
0
 public void UpdateText()
 {
     if (parentTower.UpgradeLevel >= towerStatsGetter.GetTowerMaxLevels(parentTower.TowerType) - 1)
     {
         upgradePriceText.gameObject.SetActive(false);
     }
     else
     {
         upgradePriceText.text = PlayerMoneyManager.Instance.GetPrice(
             parentTower.TowerType,
             parentTower.UpgradeLevel + 1).ToString();
     }
 }
Beispiel #2
0
    public void UpgradeTower(Tower tower, TowerType towerType)
    {
        int towerLevel     = tower.UpgradeLevel;
        int maxTowerLevels = towerStatGetter.GetTowerMaxLevels(towerType);

        towerLevel++;

        if (towerLevel < maxTowerLevels)
        {
            tower.SetStats(towerLevel,
                           towerStatGetter.GetTowerDamage(towerType, towerLevel),
                           towerStatGetter.GetTowerFireRate(towerType, towerLevel),
                           towerStatGetter.GetTowerRange(towerType, towerLevel));
        }

        PlayerMoneyManager.Instance.UseMoney(PlayerMoneyManager.Instance.GetPrice(towerType, towerLevel));
    }