| | |
| | | public Material materialMonsterOppo; |
| | | |
| | | /// <summary> |
| | | /// 当前塔防对应的攻击和等待Mat. |
| | | /// </summary> |
| | | public Material materialTowerAttackSelf; |
| | | public Material materialTowerWaitSelf; |
| | | public Material materialTowerAttackOppo; |
| | | public Material materialTowerWaitOppo; |
| | | |
| | | /// <summary> |
| | | /// 0 空状态 1 等待状态 2 攻击状态. |
| | | /// </summary> |
| | | protected int curActionState = 0; |
| | | |
| | | /// <summary> |
| | | /// 塔防对应的充能状态. |
| | | /// </summary> |
| | | public ETowerFuntion eTowerFuntion = ETowerFuntion.NULL; |
| | | public BulletUICtl bulletCtl = null; |
| | | |
| | | /// <summary> |
| | | /// The tower levels associated with this tower |
| | |
| | | /// </summary> |
| | | public float attackRise { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 塔防数据的局内升级 |
| | | /// </summary> |
| | |
| | | public bool isAtMaxLevel |
| | | { |
| | | get { return currentLevel == levels.Length - 1; } |
| | | } |
| | | |
| | | public void setTowerState(bool attack) |
| | | { |
| | | if (!materialTowerAttackSelf) return; |
| | | |
| | | if( opponentSide) |
| | | { |
| | | if (attack && (this.curActionState != 2)) |
| | | { |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerAttackOppo); |
| | | this.curActionState = 2; |
| | | } |
| | | |
| | | if ((!attack) && (this.curActionState != 1)) |
| | | { |
| | | currentTowerLevel.SetTowerMonsterMat( materialTowerWaitOppo ); |
| | | this.curActionState = 1; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (attack && (this.curActionState != 2)) |
| | | { |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerAttackSelf); |
| | | this.curActionState = 2; |
| | | } |
| | | |
| | | if ((!attack) && (this.curActionState != 1)) |
| | | { |
| | | currentTowerLevel.SetTowerMonsterMat(materialTowerWaitSelf); |
| | | this.curActionState = 1; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | else |
| | | currentTowerLevel.SetTowerMonsterMat(materialMonsterSelf); |
| | | |
| | | // 处理Tower |
| | | this.setTowerState(false); |
| | | |
| | | |
| | | if (opponentSide) |
| | | { |
| | | OpponentMgr.instance.SetTowerAttID(gridPosition.x, attributeId, this.currentLevel); |
| | |
| | | } |
| | | |
| | | // |
| | | // 根据是否是子弹塔防来决定是否显示相应的界面.WORK START: 处理出来下一步的子弹减少和对应的充子弹时间. |
| | | if (this.eTowerFuntion == ETowerFuntion.BULLET) |
| | | // 根据是否是子弹塔防来决定是否显示相应的界面 |
| | | BulletUICtl buc = this.placementArea.GetBulletUICtl(gridPosition.x); |
| | | if ( (this.eTowerFuntion == ETowerFuntion.BULLET) && (buc != null ) ) |
| | | { |
| | | BulletUICtl buc = this.placementArea.GetBulletUICtl(gridPosition.x); |
| | | if (buc) |
| | | buc.gameObject.SetActive(true); |
| | | // 设置数据 |
| | | buc.gameObject.SetActive(true); |
| | | this.bulletCtl = buc; |
| | | buc.resetToMaxBullet(); |
| | | } |
| | | else |
| | | { |
| | | // 清空数据 |
| | | buc.gameObject.SetActive(false); |
| | | this.bulletCtl = null; |
| | | } |
| | | } |
| | | |