Esempio n. 1
0
        public void Upgrade()
        {
            var price = Upgradable.GetPrice();

            if (price > ServiceLocator.GetCoinCounter().Coins || Upgradable.IsMax())
            {
                ServiceLocator.GetVoiceoverService().PlaySound(SoundType.InsufficientFunds, 0);
                return;
            }

            ServiceLocator.GetCoinCounter().Coins -= price;
            Upgradable.Upgrade();
            UpdateButtonTexts();
            ServiceLocator.AnimateProps();

            Animation.Play(ClickAnimName);
        }