public void SetCoins(int count) { var oldCount = currency.Coins; currency.SetCoins(count); if (currency.Coins != oldCount) { GameEvents.OnCoinsChanged(oldCount, currency.Coins); } }
public void RemoveCoins(int value) { UnityEngine.Debug.Log($"REMOVE COINS: {value}".Attrib(bold: true, color: "yellow")); int oldValue = currency.Coins; currency.RemoveCoins(value); if (currency.Coins != oldValue) { GameEvents.OnCoinsChanged(oldValue, currency.Coins); } }
public void AddCoins(int value, bool isFree = false) { var oldValue = currency.Coins; currency.AddCoins(value); if (!isFree) { StatsCollector.Instance[Stats.COINS_BOUGHT] += value; } StatsCollector.Instance[Stats.COINS_AQUIRED] += value; if (currency.Coins != oldValue) { GameEvents.OnCoinsChanged(oldValue, currency.Coins); } }