| | |
| | | /// </summary> |
| | | public ETowerFuntion eTowerFuntion = ETowerFuntion.NULL; |
| | | public BulletUICtl bulletCtl = null; |
| | | public EnergyUICtl energyCtl = null; |
| | | |
| | | /// <summary> |
| | | /// The tower levels associated with this tower |
| | |
| | | // 处理Tower |
| | | this.setTowerState(false); |
| | | |
| | | |
| | | if (opponentSide) |
| | | { |
| | | OpponentMgr.instance.SetTowerAttID(gridPosition.x, attributeId, this.currentLevel); |
| | |
| | | } |
| | | } |
| | | |
| | | // |
| | | // 根据是否是子弹塔防来决定是否显示相应的界面 |
| | | BulletUICtl buc = this.placementArea.GetBulletUICtl(gridPosition.x); |
| | | if ( (this.eTowerFuntion == ETowerFuntion.BULLET) && (buc != null ) ) |
| | | { |
| | | // 设置数据 |
| | | buc.gameObject.SetActive(true); |
| | | this.bulletCtl = buc; |
| | | buc.resetToMaxBullet(); |
| | | } |
| | | else |
| | | { |
| | | // 清空数据 |
| | | buc.gameObject.SetActive(false); |
| | | this.bulletCtl = null; |
| | | } |
| | | // 处理塔位边上的界面. |
| | | OnTowerUICtrl(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | protected void OnTowerUICtrl() |
| | | { |
| | | // |
| | | // 根据是否是子弹塔防来决定是否显示相应的界面 |
| | | BulletUICtl buc = this.placementArea.GetBulletUICtl(gridPosition.x); |
| | | if ((this.eTowerFuntion == ETowerFuntion.BULLET) && (buc != null)) |
| | | { |
| | | // 设置数据 |
| | | buc.gameObject.SetActive(true); |
| | | this.bulletCtl = buc; |
| | | buc.resetToMaxBullet(); |
| | | } |
| | | else |
| | | { |
| | | // 清空数据 |
| | | buc.gameObject.SetActive(false); |
| | | this.bulletCtl = null; |
| | | } |
| | | |
| | | // 根据是否是能量充能来决定是否显示相应的界面. |
| | | EnergyUICtl euc = placementArea.GetEnergyUICtl(gridPosition.x); |
| | | if( (eTowerFuntion == ETowerFuntion.ENERGY) &&(euc != null )) |
| | | { |
| | | // 设置数据 |
| | | euc.gameObject.SetActive(true); |
| | | this.energyCtl = euc; |
| | | euc.SetEnergyProgress(0); |
| | | } |
| | | else |
| | | { |
| | | // 清空数据 |
| | | euc.gameObject.SetActive(false); |
| | | this.energyCtl = null; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化当前塔防的局内升级,lvl从1开始. |
| | | /// </summary> |