public void TryBuyItem(ShopItemView itemView)
 {
     if (CurrentMoneyCount > itemView.Item.Price)
     {
         CurrentMoneyCount -= itemView.Item.Price;
         itemView.ReduceCurrentAvailableCount();
         MoneyCountChanged?.Invoke(CurrentMoneyCount);
         ItemBought?.Invoke(itemView);
     }
 }
    private void Start()
    {
        CurrentMoneyCount = _startMoneyCount;

        MoneyCountChanged?.Invoke(CurrentMoneyCount);
    }
Exemple #3
0
 public void RecruitUnit(UnitStats unit)
 {
     _money -= unit.Price;
     MoneyCountChanged?.Invoke(_money);
     UnitRecruited?.Invoke(unit.Prefab);
 }
Exemple #4
0
 public void CollectMoney(int money)
 {
     _money += money;
     MoneyCountChanged?.Invoke(_money);
 }
Exemple #5
0
 private void Awake()
 {
     MoneyCountChanged?.Invoke(_money);
 }