private void Bought() { Money.DecreaseAmount(cost); if (item is Usable_Amount_Item) { if (collectedItems.items.Contains(item)) { (item as Usable_Amount_Item).amount.IncreaseAmount(amountToBuy); } else { collectedItems.AddItem(item); (item as Usable_Amount_Item).amount.value = amountToBuy; } } else if (item is Non_Usable_Amount_Item) { if (collectedItems.items.Contains(item)) { (item as Non_Usable_Amount_Item).amount.IncreaseAmount(amountToBuy); } else { collectedItems.AddItem(item); (item as Non_Usable_Amount_Item).amount.value = amountToBuy; } } else { collectedItems.AddItem(item); } Debug.Log("Buy"); BoughtEvent.Invoke(); }
public override void DecreaseAmount(int amount) { base.DecreaseAmount(amount); FullHealth.DecreaseAmount(amount); }