chenxin
2020-11-17 344267a8edb7bc6eaa67a0493292f438d31ca20e
Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -109,6 +109,8 @@
        /// </summary>
        public Button randomTowerBtn;
        public Button SkillTowerBtn;
        /// <summary>
        /// 飘血数字对应的prefab.
        /// </summary>
@@ -128,6 +130,8 @@
        /// 购买塔防按钮上的Text.
        /// </summary>
        protected TextMeshProUGUI towerPriceText;
        protected TextMeshProUGUI towerPriceText1;
        protected bool tdBuyDisable = false;
@@ -735,13 +739,13 @@
        /// <param name="tower"></param>
        protected void growUpTower(Tower tower)
        {
            Tower newTower = EndlessRandomTower.instance.GetRandomTower(false);
            Tower newTower = EndlessRandomTower.instance.GetRandomTower(EFeatureTower.NULL, true);
            // 所有的Tower不能升级成为FeatureTower.
            int maxLoop = 20;
            while (newTower.towerFeature != EFeatureTower.NULL)
            {
                newTower = EndlessRandomTower.instance.GetRandomTower(false);
                newTower = EndlessRandomTower.instance.GetRandomTower(EFeatureTower.NULL, true);
                maxLoop--;
                if (maxLoop <= 0)
                {
@@ -1794,12 +1798,16 @@
            if (!towerPriceText)
            {
                towerPriceText = randomTowerBtn.transform.Find("cashText").GetComponent<TextMeshProUGUI>();
                towerPriceText1 = SkillTowerBtn.transform.Find("cashText").GetComponent<TextMeshProUGUI>();
                if (towerPriceText)
                    towerPriceText.text = tpMgr.currentTowerPrice.ToString();
                if (towerPriceText1)
                    towerPriceText1.text = tpMgr.currentTowerPrice.ToString();
            }
            else
            {
                towerPriceText.text = tpMgr.currentTowerPrice.ToString();
                towerPriceText1.text = tpMgr.currentTowerPrice.ToString();
            }
            // 无法支付新的塔防价格,按钮变灰.
@@ -1819,6 +1827,7 @@
            if (towerPriceText)
            {
                towerPriceText.color = new Color(0.5f, 0.5f, 0.5f);
                towerPriceText1.color = new Color(0.5f, 0.5f, 0.5f);
            }
            tdBuyDisable = true;
        }
@@ -1834,7 +1843,10 @@
                return;
            if (towerPriceText)
            {
                towerPriceText.color = new Color(1.0f, 1.0f, 1.0f);
                towerPriceText1.color = new Color(1.0f, 1.0f, 1.0f);
            }
            if (randomTowerBtn)
            {