| | |
| | | using System; |
| | | using System.Collections; |
| | | using System; |
| | | using ActionGameFramework.Health; |
| | | using Core.Utilities; |
| | | using TowerDefense.Level; |
| | |
| | | /// 播放充能状态特效. |
| | | /// </summary> |
| | | /// <param name="play"></param> |
| | | public void PlayEnergyEffect(bool play) |
| | | public void PlayEnergyEffect(bool play, bool isClose = true) |
| | | { |
| | | if (this.energyCtl) |
| | | if (this.energyCtl && isClose) |
| | | energyCtl.gameObject.SetActive(!play); |
| | | else if(!isClose){ |
| | | |
| | | } |
| | | |
| | | if (!opponentSide) |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// This function is called when the object becomes enabled and active. |
| | | /// </summary> |
| | | void OnEnable() |
| | | { |
| | | |
| | | // if (bulletCtl != null) |
| | | // { |
| | | // Debug.Log("打开了bulletCtl"); |
| | | // bulletCtl.gameObject.SetActive(true); |
| | | // } |
| | | |
| | | |
| | | // if (energyCtl != null) |
| | | // { |
| | | // Debug.Log("打开了energyCtl"); |
| | | // energyCtl.gameObject.SetActive(true); |
| | | // } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// This function is called when the behaviour becomes disabled or inactive. |
| | | /// </summary> |
| | | void OnDisable() |
| | | { |
| | | if (bulletCtl != null) |
| | | { |
| | | bulletCtl.gameObject.SetActive(false); |
| | | } |
| | | |
| | | if (energyCtl != null) |
| | | { |
| | | energyCtl.gameObject.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化当前塔防的局内升级,lvl从1开始. |
| | | /// </summary> |
| | | /// <param name="lvl"></param> |
| | |
| | | // 初始化当前的局内Tower等级数据 |
| | | this.initInSceneTowerLevel(SceneTowerLvl.getInSceneTowerLvl(this.towerName)); |
| | | |
| | | StartCoroutine(ResetScale()); |
| | | } |
| | | |
| | | IEnumerator ResetScale() |
| | | { |
| | | yield return new WaitForSeconds(0.2f); |
| | | if (gridPosition.y > 1) |
| | | { |
| | | currentTowerLevel.ResetScale(); |