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

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