Beispiel #1
0
        private void UpgradeButtonClick()
        {
            if (m_dynamicParameter.IsMaxLevel)
            {
                return;
            }

            if (IsAdUpgrade)
            {
                string parameterName = m_dynamicParameter.ParameterType.ToFriendlyName();

                BuyService buyService = new AdBuyService(string.Format(StringConstants.Formats.AdUpgradeParameterFormat, parameterName));
                buyService.TryToBuy(0, () =>
                {
                    m_upgradesCount = 0;
                    m_dynamicParameter.Upgrade();
                });
            }
            else
            {
                BuyService buyService = new RespectBuyService();
                buyService.TryToBuy((int)m_dynamicParameter.Price, () =>
                {
                    m_upgradesCount++;
                    m_dynamicParameter.Upgrade();
                });
            }

            AudioClipData audioClipData = ConfigManager.Instance.Get <AudioConfig>().UpgradeParameterAudioClipData;

            AudioManager.Instance.PlaySoundFx(audioClipData);
        }
        protected override void UnlockAutoCollecting()
        {
            BuyService buyService = new RespectBuyService();

            buyService.TryToBuy(m_buildingConfig.AutoCollectingPrice, base.UnlockAutoCollecting);
        }
        protected override void UnlockBuilding()
        {
            RespectBuyService respectBuyService = new RespectBuyService();

            respectBuyService.TryToBuy(m_buildingConfig.UnlockPrice, () => base.UnlockBuilding());
        }