From 40b918d5189a154bc0ff31627e69867742934720 Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Tue, 17 Nov 2020 21:10:05 +0800 Subject: [PATCH] buff补充 --- Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs index 06f54ea..6b4033b 100644 --- a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs +++ b/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; @@ -731,13 +735,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) { @@ -1030,7 +1034,7 @@ { if (!TryPlaceTower(pointerInfo, false, true)) { - CancelPlaceTower(pointerInfo); + CancelPlaceTower(pointerInfo); Debug.Log("这里需要返回原位"); return; @@ -1770,12 +1774,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(); } // 无法支付新的塔防价格,按钮变灰. @@ -1795,6 +1803,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; } @@ -1810,7 +1819,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) { -- Gitblit v1.9.1