From 893f645dafa46b818a2edb9fa40337af0c3598d6 Mon Sep 17 00:00:00 2001 From: chenxin <chenxin6991@163.com> Date: Fri, 06 Nov 2020 19:57:10 +0800 Subject: [PATCH] 修改买塔规则 爱心破碎特效 基地血条不掉问题 --- Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs | 20 +++++--------------- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs index 7f9fa31..81fec58 100644 --- a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs +++ b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs @@ -250,7 +250,7 @@ /// 保存所有生成或合成的塔的最小等级,索引0 -> 火木水塔 索引1 -> 技能塔 /// </summary> /// <value></value> - public int[] MinLevelArr = { 0, 0 }; + public int MinLevel; public IPlacementArea selfTowerPlaceArea { @@ -268,25 +268,15 @@ private void UpdateMinLevelArr() { - int min1 = -1; - int min2 = -1; + int min = -1; for (int i = 0; i < m_listTower.Count; ++i) { - if (m_listTower[i].towerFeature == EFeatureTower.NULL) - { - if (min1 == -1 || m_listTower[i].currentLevel < min1) - min1 = m_listTower[i].currentLevel; - } - else - { - if (min2 == -1 || m_listTower[i].currentLevel < min2) - min2 = m_listTower[i].currentLevel; - } + if (min == -1 || m_listTower[i].currentLevel < min) + min = m_listTower[i].currentLevel; } - MinLevelArr[0] = Mathf.Max(min1, 0); - MinLevelArr[1] = Mathf.Max(min2, 0); + MinLevel = Mathf.Max(min, 0); } /// <summary> -- Gitblit v1.9.1