| | |
| | | using UnityEngine.UI; |
| | | using TMPro; |
| | | using KTGMGemClient; |
| | | using DG.Tweening; |
| | | |
| | | public class EndlessRandomTower : Singleton<EndlessRandomTower> |
| | | { |
| | |
| | | /// 购买二级宝石的按钮贴图. |
| | | /// </summary> |
| | | public Sprite buyBtnLevelUp; |
| | | |
| | | [SerializeField] |
| | | private TextMeshProUGUI cashText; |
| | | |
| | | protected bool bSetBuyLvlUp; |
| | | |
| | |
| | | |
| | | if (EndlessGameUI.instance.tdBuyDisable) |
| | | { |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.SetTowerGridOpenRed); |
| | | cashText.color = new Color(1f, 0f, 0f); |
| | | DOTween.To(() => cashText.color, (Color v) => cashText.color = v, cashText.color, 0.2f) |
| | | .OnComplete(CheckCurrencyEnough); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | private void CheckCurrencyEnough() |
| | | { |
| | | int result; |
| | | int.TryParse(cashText.text.ToString(), out result); |
| | | int current = EndlessLevelManager.instance.Currency.currentCurrency; |
| | | |
| | | if (current >= result) |
| | | EndlessGameUI.instance.enableRandomTowerBtn(); |
| | | else |
| | | EndlessGameUI.instance.disableRandomTowerBtn(); |
| | | } |
| | | |
| | | private List<string> towerNameLis = new List<string>();//用来判断是否是首次购买宝石 |
| | | |
| | | /// <summary> |