public static void RemoveGoldAmount(int amount) { goldAmount -= amount; if (goldAmount < 0) { goldAmount = 0; } OnGoldAmountChanged?.Invoke(null, EventArgs.Empty); }
public bool TrySpendGoldAmount(int spendGoldAmount) { if (GetGoldAmount() >= spendGoldAmount) { goldAmount -= spendGoldAmount; OnGoldAmountChanged?.Invoke(this, EventArgs.Empty); return(true); } else { return(false); } }
public bool TrySpendGoldAmount(int spendGoldAmount) { if (GameManager.currentMoney >= spendGoldAmount) { GameManager.currentMoney -= spendGoldAmount; OnGoldAmountChanged?.Invoke(this, EventArgs.Empty); return(true); } else { return(false); } }
public void AddGoldAmount(int addGoldAmount) { goldAmount += addGoldAmount; OnGoldAmountChanged?.Invoke(this, EventArgs.Empty); }
public static void AddGoldAmount(int amount) { goldAmount += amount; OnGoldAmountChanged?.Invoke(null, EventArgs.Empty); }