Beispiel #1
0
 public static void RemoveGoldAmount(int amount)
 {
     goldAmount -= amount;
     if (goldAmount < 0)
     {
         goldAmount = 0;
     }
     OnGoldAmountChanged?.Invoke(null, EventArgs.Empty);
 }
Beispiel #2
0
 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);
     }
 }
Beispiel #4
0
 public void AddGoldAmount(int addGoldAmount)
 {
     goldAmount += addGoldAmount;
     OnGoldAmountChanged?.Invoke(this, EventArgs.Empty);
 }
Beispiel #5
0
 public static void AddGoldAmount(int amount)
 {
     goldAmount += amount;
     OnGoldAmountChanged?.Invoke(null, EventArgs.Empty);
 }