| | |
| | | using System; |
| | | using System.Collections; |
| | | using System; |
| | | using ActionGameFramework.Health; |
| | | using Core.Utilities; |
| | | using TowerDefense.Level; |
| | |
| | | { |
| | | if (attack && (this.curActionState != 2)) |
| | | { |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerAttackOppo); |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerAttackOppo, true); |
| | | this.curActionState = 2; |
| | | } |
| | | |
| | | if ((!attack) && (this.curActionState != 1)) |
| | | { |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitOppo); |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitOppo, false); |
| | | this.curActionState = 1; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (attack && (this.curActionState != 2)) |
| | | { |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerAttackSelf); |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerAttackSelf, true); |
| | | this.curActionState = 2; |
| | | } |
| | | |
| | | if ((!attack) && (this.curActionState != 1)) |
| | | { |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitSelf); |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitSelf, false); |
| | | this.curActionState = 1; |
| | | } |
| | | } |
| | |
| | | /// 播放充能状态特效. |
| | | /// </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) |
| | | { |
| | |
| | | if (value) |
| | | { |
| | | if (opponentSide) |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitOppo); |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitOppo, false); |
| | | else |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitSelf); |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitSelf, false); |
| | | |
| | | // 处理Tower |
| | | this.setTowerState(false); |
| | |
| | | } |
| | | |
| | | /// <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> |
| | |
| | | return; |
| | | } |
| | | // 设置攻击数据的加强,暂时是测试数据,后面需要读取表格数据处理: |
| | | float damageAdd = (inSceneTowerLevel - 1) * this.INSCENE_TU_DAMAGE; |
| | | float damageAdd = 0; |
| | | // float damageAdd = (inSceneTowerLevel - 1) * this.INSCENE_TU_DAMAGE; |
| | | for (int ti = 0; ti < this.levels.Length; ti++) |
| | | { |
| | | if (levels[ti].levelDamager) |
| | |
| | | // 初始化当前的局内Tower等级数据 |
| | | this.initInSceneTowerLevel(SceneTowerLvl.getInSceneTowerLvl(this.towerName)); |
| | | |
| | | StartCoroutine(ResetScale()); |
| | | } |
| | | |
| | | IEnumerator ResetScale() |
| | | { |
| | | yield return new WaitForSeconds(0.2f); |
| | | if (gridPosition.y > 1) |
| | | { |
| | | currentTowerLevel.ResetScale(); |
| | | }else{ |
| | | } |
| | | else |
| | | { |
| | | currentTowerLevel.NormalScale(); |
| | | } |
| | | } |