From 69e0fea6c92fd4e153d45e5f26ef89baecf0405a Mon Sep 17 00:00:00 2001
From: weixudong <weixudong4700@ktgame.com>
Date: Thu, 19 Nov 2020 08:51:09 +0800
Subject: [PATCH] Merge branch 'master' of ssh://172.16.1.52:8091/GemBattle into master

---
 Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs |   53 ++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
index 2023709..a2ab1bd 100644
--- a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
+++ b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -272,7 +272,7 @@
         public GameObject woodAppearEffect1;
         public GameObject woodAppearEffect2;
         /// <summary>
-        /// 保存所有生成或合成的塔的最小等级,索引0 -> 火木水塔 索引1 -> 技能塔
+        /// 保存所有生成或合成的塔的最小等级
         /// </summary>
         /// <value></value>
         public int MinLevel;
@@ -882,29 +882,38 @@
             {
                 if (m_CurrentTower.controller.towerFeature == EFeatureTower.NULL)
                 {
-                    List<IntVector2> allTowerP = new List<IntVector2>();
-                    List<IntVector2> allPSTowerP = new List<IntVector2>();//需要播放升级动画的
+                    List<IntVector2> allTowerP = null;//排除不能合成的
+                    // List<IntVector2> allPSTowerP = new List<IntVector2>();//需要播放升级动画的
 
-                    for (int i = 0; i < m_listTower.Count; i++)
+                    if (towerToMove)
                     {
-                        if (m_listTower[i].bInAttackMode && towerToMove && m_listTower[i].currentLevel == dragTowerLevel && m_listTower[i].towerName == towerToMove.towerName)
+                        if (towerToMove.gridPosition.y == 0 || towerToMove.gridPosition.y == 1)
                         {
-                            if (towerToMove.gridPosition != m_listTower[i].gridPosition)
-                                //说明可以合成
-                                allPSTowerP.Add(m_listTower[i].gridPosition);
+                            allTowerP = new List<IntVector2>();
+                            for (int i = 0; i < m_listTower.Count; i++)
+                            {
+                                if (m_listTower[i].bInAttackMode && towerToMove && m_listTower[i].currentLevel == dragTowerLevel && m_listTower[i].towerName == towerToMove.towerName)
+                                {
+                                    // if (towerToMove.gridPosition != m_listTower[i].gridPosition)
+                                    //     //说明可以合成
+                                    //     allPSTowerP.Add(m_listTower[i].gridPosition);
+                                }
+                                else
+                                {
+                                    //把不符合条件的传进去
+                                    allTowerP.Add(m_listTower[i].gridPosition);
+                                }
+                            }
                         }
-                        else
-                        {
-                            //把不符合条件的传进去
-                            allTowerP.Add(m_listTower[i].gridPosition);
-                        }
+
                     }
+
                     if (m_CurrentArea != null)
                     {
+                        //修改为只要开启格子都可以放
                         (m_CurrentArea as TowerPlacementGridEndless).CheckAllCanPlace(allTowerP);
                         //(m_CurrentArea as TowerPlacementGridEndless).PlayPS(allPSTowerP);
                     }
-
 
                 }
                 else if (m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Fire || m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Bomb)
@@ -1033,7 +1042,10 @@
 
             // 判断目标位置是否有Tower且类型和等级一致,如果没有,则GhostTower删除,原Tower显示。
             if (isValidateCombineTarget(pointerInfo))
+            {
                 TryPlaceTower(pointerInfo);
+                EndlessRandomTower.instance.UpdateDescDisplay();
+            }
             else if (isFreeAttackGrid(pointerInfo) && !bSkill)
             {
                 if (!TryPlaceTower(pointerInfo, false, true))
@@ -1864,6 +1876,8 @@
         /// <param name="val"></param>
         public void generateBloodText(Vector3 wpos, float val, bool crit = false, bool doubleHit = false, bool poison = false)
         {
+            if (Mathf.FloorToInt(val) == 0) return;
+
             Vector3 spos = m_Camera.WorldToScreenPoint(wpos);
             TextMoveDoTween tm;
             if (crit)
@@ -1989,6 +2003,7 @@
             bool successfulPurchase = EndlessLevelManager.instance.Currency.TryPurchase(cost);
             if (!successfulPurchase) return false;
 
+            EndlessRandomTower.instance.UpdateDescDisplay();
             SetUpGhostTower(tow);
             //Debug.Log("设置影子塔防.");
             m_CurrentTower.Show();
@@ -2140,7 +2155,7 @@
             base.Awake();
 
             randomTowerBtn = transform.Find("BottomCanvas/Panel/TowerBuyBtn").GetComponent<Button>();
-            DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10);
+            //DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10);
 
             state = State.Normal;
             m_Camera = GameObject.Find("SceneCamera3D").GetComponent<Camera>();
@@ -2301,6 +2316,14 @@
                         }
                         //selEff.SetWaveLineSel(true);
                     }
+                    else
+                    {
+                        if (currentEffect != null)
+                        {
+                            currentEffect.SetParticleSystem(false);
+                            currentEffect = null;
+                        }
+                    }
                 }
                 // 炸弹是区域攻击显示:
                 else if (m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Bomb)

--
Gitblit v1.9.1