| | |
| | | m_Tower = towerToShow; |
| | | AdjustPosition(); |
| | | |
| | | int sellValue = m_Tower.GetSellLevel(); |
| | | /// |
| | | // TEST COED TO DELETE: |
| | | if( sellButton != null) |
| | | { |
| | |
| | | |
| | | 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); |
| | |
| | | { |
| | | if (m_Tower != null && upgradeButton != null) |
| | | { |
| | | upgradeButton.interactable = |
| | | LevelManager.instance.currency.CanAfford(m_Tower.GetCostForNextLevel()); |
| | | upgradeButton.interactable = true; |
| | | } |
| | | } |
| | | |