From 24f59b89e9eabcfe948fc0ba304a8dbec2deda14 Mon Sep 17 00:00:00 2001 From: River Jiang <546213258@qq.com> Date: Tue, 27 Oct 2020 14:09:47 +0800 Subject: [PATCH] Merge branch 'master' of http://172.16.1.52:8090/r/GemBattle into master --- Assets/Scripts/TowerDefense/Towers/Tower.cs | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/TowerDefense/Towers/Tower.cs b/Assets/Scripts/TowerDefense/Towers/Tower.cs index aa5022a..b5a661a 100644 --- a/Assets/Scripts/TowerDefense/Towers/Tower.cs +++ b/Assets/Scripts/TowerDefense/Towers/Tower.cs @@ -140,7 +140,7 @@ { if (!materialTowerAttackSelf) return; - if( opponentSide) + if (opponentSide) { if (attack && (this.curActionState != 2)) { @@ -150,7 +150,7 @@ if ((!attack) && (this.curActionState != 1)) { - currentTowerLevel.SetTowerMonsterMat( materialTowerWaitOppo ); + currentTowerLevel.SetTowerMonsterMat(materialTowerWaitOppo); this.curActionState = 1; } } @@ -227,9 +227,11 @@ /// </summary> protected void OnTowerUICtrl() { - // // 根据是否是子弹塔防来决定是否显示相应的界面 - BulletUICtl buc = this.placementArea.GetBulletUICtl(gridPosition.x); + BulletUICtl buc = this.placementArea.GetBulletUICtl(gridPosition.x, gridPosition.y); + + if (buc == null) return; + if ((this.eTowerFuntion == ETowerFuntion.BULLET) && (buc != null)) { // 设置数据 @@ -245,8 +247,8 @@ } // 根据是否是能量充能来决定是否显示相应的界面. - EnergyUICtl euc = placementArea.GetEnergyUICtl(gridPosition.x); - if( (eTowerFuntion == ETowerFuntion.ENERGY) &&(euc != null )) + EnergyUICtl euc = placementArea.GetEnergyUICtl(gridPosition.x, gridPosition.y); + if ((eTowerFuntion == ETowerFuntion.ENERGY) && (euc != null)) { // 设置数据 euc.gameObject.SetActive(true); -- Gitblit v1.9.1