| | |
| | | createdTower.Initialize(m_CurrentArea, pos); |
| | | createdTower.SetLevel(level - 1); |
| | | |
| | | PlayUpgradeEffect(createdTower); |
| | | |
| | | addTower(createdTower); |
| | | Destroy(currentTower.gameObject); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 播放宝石出现特效 |
| | | /// </summary> |
| | |
| | | if (ps == null) |
| | | ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>(); |
| | | |
| | | ps.Play(); |
| | | Destroy(obj, ps.main.duration); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 播放升级特效 |
| | | /// </summary> |
| | | /// <param name="worldPos"></param> |
| | | public void GuidePlayUpgradeEffect(Vector3 position) |
| | | { |
| | | GameObject effect = TowerUpgradeEffectPrefab; |
| | | |
| | | // 在sTower的位置播放升级特效 |
| | | GameObject obj = Instantiate(effect); |
| | | obj.transform.position = position; |
| | | Vector3 pos = obj.transform.position; |
| | | pos.y += 5f; |
| | | obj.transform.position = pos; |
| | | ParticleSystem ps = obj.GetComponent<ParticleSystem>(); |
| | | |
| | | if (ps == null) |
| | | ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>(); |
| | | ps.Play(); |
| | | Destroy(obj, ps.main.duration); |
| | | } |
| | |
| | | /// </summary> |
| | | protected void disableRandomTowerBtn() |
| | | { |
| | | randomTowerBtn.interactable = false; |
| | | randomTowerBtn.GetComponent<EndlessRandomTower>().ChangeBtnClick(); |
| | | //randomTowerBtn.interactable = false; |
| | | if (towerPriceText) |
| | | { |
| | | towerPriceText.color = new Color(0.5f, 0.5f, 0.5f); |
| | |
| | | towerPriceText.color = new Color(1.0f, 1.0f, 1.0f); |
| | | |
| | | if (randomTowerBtn) |
| | | randomTowerBtn.interactable = true; |
| | | { |
| | | randomTowerBtn.GetComponent<EndlessRandomTower>().ChangeBtnClickNormal(); |
| | | //randomTowerBtn.interactable = true; |
| | | } |
| | | tdBuyDisable = false; |
| | | } |
| | | |