| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using TowerDefense.UI.HUD; |
| | | using DG.Tweening; |
| | | using TowerDefense.Towers.Placement; |
| | |
| | | /// </summary> |
| | | protected EndlessLevelManager levelManager; |
| | | |
| | | // Start is called before the first frame update |
| | | private void Start() |
| | | /// <summary> |
| | | /// 最终波次文本 |
| | | /// </summary> |
| | | public Text FinalWaveText; |
| | | |
| | | /// <summary> |
| | | /// 道具列表UI |
| | | /// </summary> |
| | | public GameObject PropListUI; |
| | | |
| | | public GameObject SettlementUI; |
| | | |
| | | public void Init() |
| | | { |
| | | LazyLoad(); |
| | | levelManager.LevelCompleted -= Victory; |
| | | levelManager.LevelCompleted += Victory; |
| | | } |
| | | |
| | |
| | | |
| | | if (EndlessGameUI.instance.state == EndlessGameUI.State.Building) |
| | | EndlessGameUI.instance.CancelGhostPlacement(); |
| | | |
| | | gameObject.SetActive(true); |
| | | |
| | | RefreshFinalWave(); |
| | | RefreshPropList(); |
| | | SettlementUI.SetActive(true); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (levelManager == null && EndlessLevelManager.instanceExists) |
| | | levelManager = EndlessLevelManager.instance; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新最终波次信息 |
| | | /// </summary> |
| | | /// <param name="level">关卡等级</param> |
| | | /// <param name="wave">波次</param> |
| | | private void RefreshFinalWave() |
| | | { |
| | | int level = EndlessLevelManager.instance.CurrentLevel; |
| | | int wave = EndlessLevelManager.instance.WaveManager.CurrentWaveIndex; |
| | | |
| | | FinalWaveText.text = $"最终波次:第{level}关,第{wave}波"; |
| | | } |
| | | |
| | | private void RefreshPropList() |
| | | { |
| | | EndlessSettlementPropList list = PropListUI.GetComponent<EndlessSettlementPropList>(); |
| | | list.RefreshList(); |
| | | } |
| | | } |
| | | } |