River Jiang
2020-10-22 9ba26d8f5c0103d9f6bbc15ec76dde8ec935979b
Assets/Scripts/TowerDefense/Towers/Tower.cs
@@ -62,6 +62,8 @@
        /// </summary>
        public Material materialTowerAttackSelf;
        public Material materialTowerWaitSelf;
        public Material materialTowerAttackOppo;
        public Material materialTowerWaitOppo;
        /// <summary>
        /// 0 空状态  1 等待状态  2 攻击状态.
@@ -137,16 +139,33 @@
        {
            if (!materialTowerAttackSelf) return;
            if (attack && (this.curActionState != 2))
            if( opponentSide)
            {
                currentTowerLevel.SetTowerMonsterMat(materialTowerAttackSelf);
                this.curActionState = 2;
            }
                if (attack && (this.curActionState != 2))
                {
                    currentTowerLevel.SetTowerMonsterMat(materialTowerAttackOppo);
                    this.curActionState = 2;
                }
            if ((!attack) && (this.curActionState != 1))
                if ((!attack) && (this.curActionState != 1))
                {
                    currentTowerLevel.SetTowerMonsterMat( materialTowerWaitOppo );
                    this.curActionState = 1;
                }
            }
            else
            {
                currentTowerLevel.SetTowerMonsterMat(materialTowerWaitSelf);
                this.curActionState = 1;
                if (attack && (this.curActionState != 2))
                {
                    currentTowerLevel.SetTowerMonsterMat(materialTowerAttackSelf);
                    this.curActionState = 2;
                }
                if ((!attack) && (this.curActionState != 1))
                {
                    currentTowerLevel.SetTowerMonsterMat(materialTowerWaitSelf);
                    this.curActionState = 1;
                }
            }
        }
@@ -172,11 +191,11 @@
                    if (opponentSide)
                        currentTowerLevel.SetTowerMonsterMat(materialMonsterOppo);
                    else
                    {
                        currentTowerLevel.SetTowerMonsterMat(materialMonsterSelf);
                        this.setTowerState(false);
                    }
                    // 处理Tower
                    this.setTowerState(false);
                    if (opponentSide)
                    {
@@ -198,17 +217,21 @@
                    // 
                    // 根据是否是子弹塔防来决定是否显示相应的界面
                    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);
                            this.bulletCtl = buc;
                            buc.resetToMaxBullet();
                        }*/
                        // 设置数据
                        buc.gameObject.SetActive(true);
                        this.bulletCtl = buc;
                        buc.resetToMaxBullet();
                    }
                    else
                    {
                        // 清空数据
                        buc.gameObject.SetActive(false);
                        this.bulletCtl = null;
                    }*/
                }
            }