chenxin
2020-12-01 944950c86ab3be21c22b7c15039cf2e572efdc90
Assets/Scripts/TowerDefense/UI/HUD/TowerUI.cs
@@ -74,8 +74,6 @@
         m_Tower = towerToShow;
         AdjustPosition();
         int sellValue = m_Tower.GetSellLevel();
         ///
         // TEST COED TO DELETE:
         if( sellButton != null)
         {
@@ -97,23 +95,11 @@
         m_Canvas.enabled = true;
         ///
         if (sellButton != null)
         {
            sellButton.gameObject.SetActive(sellValue > 0);
         }
         if (upgradeButton != null)
         {
            upgradeButton.interactable =
               LevelManager.instance.currency.CanAfford(m_Tower.GetCostForNextLevel());
                upgradeButton.interactable = true;
            bool maxLevel = m_Tower.isAtMaxLevel;
            upgradeButton.gameObject.SetActive(!maxLevel);
            if (!maxLevel)
            {
               upgradeDescription.text =
                  m_Tower.levels[m_Tower.currentLevel + 1].upgradeDescription.ToUpper();
            }
         }
         LevelManager.instance.currency.currencyChanged += OnCurrencyChanged;
         towerInfoDisplay.Show(towerToShow);
@@ -245,8 +231,7 @@
      {
         if (m_Tower != null && upgradeButton != null)
         {
            upgradeButton.interactable =
               LevelManager.instance.currency.CanAfford(m_Tower.GetCostForNextLevel());
                upgradeButton.interactable = true;
         }
      }