| | |
| | | /// </summary> |
| | | protected TextMeshProUGUI towerPriceText; |
| | | |
| | | protected TextMeshProUGUI towerPriceText1; |
| | | //protected TextMeshProUGUI towerPriceText1; |
| | | |
| | | protected bool tdBuyDisable = false; |
| | | |
| | |
| | | |
| | | // 让所有兵线上已经生成的所有agent播放一个死亡动画然后销毁 |
| | | WaveLineAgentInsMgr[] waveLineAgentIns = AgentInsManager.instance.GetWaveLineList(); |
| | | GameOver(); |
| | | |
| | | for (int i = 0; i < waveLineAgentIns.Length; ++i) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | GameOver(); |
| | | overTimer = new Timer(1.2f, SafelyCallGameOverEvent); |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | BuyTower(pointer, force, zeroCost); |
| | | |
| | | return true; |
| | | return BuyTower(pointer, force, zeroCost); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// Throws exception when not in a build mode or when tower is not a valid position |
| | | /// </exception> |
| | | /// </summary> |
| | | public void BuyTower(UIPointer pointer, bool force = false, bool zeroCost = false) |
| | | public bool BuyTower(UIPointer pointer, bool force = false, bool zeroCost = false) |
| | | { |
| | | if (!isBuilding) return; |
| | | if (!isBuilding) return false; |
| | | |
| | | // 判断是否格子上重复放置塔防 |
| | | if (!m_CurrentTower || !IsGhostAtValidPosition()) |
| | |
| | | if (!pointer.raycast.HasValue || pointer.raycast.Value.collider == null) |
| | | { |
| | | CancelGhostPlacement(); |
| | | return; |
| | | return false; |
| | | } |
| | | PlaceGhost(pointer); |
| | | } |
| | | return; |
| | | return true; |
| | | } |
| | | |
| | | // 这是判断是否超出了格子 |
| | |
| | | if (!pointer.raycast.HasValue || pointer.raycast.Value.collider == null) |
| | | { |
| | | CancelGhostPlacement(); |
| | | return; |
| | | return false; |
| | | } |
| | | |
| | | int cost = m_CurrentTower.controller.purchaseCost; |
| | |
| | | { |
| | | PlaceGhost(pointer); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (!towerPriceText) |
| | | { |
| | | towerPriceText = randomTowerBtn.transform.Find("cashText").GetComponent<TextMeshProUGUI>(); |
| | | towerPriceText1 = SkillTowerBtn.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(); |
| | | // if (towerPriceText1) |
| | | // towerPriceText1.text = tpMgr.currentTowerPrice.ToString(); |
| | | } |
| | | else |
| | | { |
| | | towerPriceText.text = tpMgr.currentTowerPrice.ToString(); |
| | | towerPriceText1.text = tpMgr.currentTowerPrice.ToString(); |
| | | //towerPriceText1.text = tpMgr.currentTowerPrice.ToString(); |
| | | } |
| | | |
| | | // 无法支付新的塔防价格,按钮变灰. |
| | |
| | | if (towerPriceText) |
| | | { |
| | | towerPriceText.color = new Color(0.5f, 0.5f, 0.5f); |
| | | towerPriceText1.color = new Color(0.5f, 0.5f, 0.5f); |
| | | //towerPriceText1.color = new Color(0.5f, 0.5f, 0.5f); |
| | | } |
| | | tdBuyDisable = true; |
| | | } |
| | |
| | | if (towerPriceText) |
| | | { |
| | | towerPriceText.color = new Color(1.0f, 1.0f, 1.0f); |
| | | towerPriceText1.color = new Color(1.0f, 1.0f, 1.0f); |
| | | //towerPriceText1.color = new Color(1.0f, 1.0f, 1.0f); |
| | | } |
| | | |
| | | if (randomTowerBtn) |