Пример #1
0
        public void SpendCoins(int amount)
        {
            if (amount > totalCoinsCollected)
            {
                throw new Exception("Trying to spend more coins than available, this is never allowed to happen!");
            }

            totalCoinsCollected -= amount;
            PlayerPrefs.SetInt(TOTAL_COINS_COLLECTED_KEY, totalCoinsCollected);

            TotalCoinsUpdatedEvent?.Invoke(totalCoinsCollected);
        }
Пример #2
0
 private void OnHitCoinPickup()
 {
     totalCoinsCollected += worldSequenceController.CurrentMultiplier;
     TotalCoinsUpdatedEvent?.Invoke(totalCoinsCollected);
 }