private void OnUiManagerUpgraded(ICanUpgrade target, IUpgrader upgrader) { if (_collectedGold >= target.Cost) { upgrader.Upgrade(target); } }
public IUpgradeData GetUpgradeData(ICanUpgrade target) { var tower = target as DefaultTower; if (tower != null) { var data = GetData(tower); return(data); } return(null); }
public void Upgrade(ICanUpgrade target) { var data = GetUpgradeData(target); target.Upgrade(data); }
private void DefaultUpgradeTowerPanelOnUpgradeClicked(ICanUpgrade upgrade, IUpgrader upgrader) { Upgraded?.Invoke(upgrade, upgrader); }