From aadfae81e6a511cd2c062ab0b05f3ee3419f1a7f Mon Sep 17 00:00:00 2001
From: wangguan <wangguan@kt007.com>
Date: Wed, 23 Dec 2020 20:15:14 +0800
Subject: [PATCH] 选中BUFF塔播放相应的特效

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

diff --git a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
index 70623bf..9c93218 100644
--- a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
+++ b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -337,6 +337,44 @@
                 disableRandomTowerBtn();
         }
 
+        public void PlayBuffPS(int get_buffID)
+        {
+            //Debug.Log("开始播放特效");
+            int targetID = 0;
+            switch (get_buffID)
+            {
+                case 0:
+                    //无特效
+                    break;
+                case 1:
+                    for (int i = 0; i < m_listTower.Count; i++)
+                    {
+                        m_listTower[i].CurrentTowerLevel.ShowBuffPS();
+                    }
+                    break;
+                case 2:
+                    targetID = 101;
+                    break;
+                case 3:
+                    targetID = 201;
+                    break;
+                case 4:
+                    targetID = 301;
+                    break;
+            }
+            if (targetID > 1)
+            {
+                for (int i = 0; i < m_listTower.Count; i++)
+                {
+                    if (m_listTower[i].ElfId == targetID)
+                    {
+                        m_listTower[i].CurrentTowerLevel.ShowBuffPS();
+                    }
+                }
+            }
+
+        }
+
         /// <summary>
         /// 根据塔位索引位置,查找位置上是否有对应的塔防数据。
         /// </summary>
@@ -2249,6 +2287,8 @@
             }
             //placeObj = GameObject.FindGameObjectWithTag("PlaceTowerOpponent");
             EventCenter.Ins.Add((int)KTGMGemClient.EventType.EndlessHeartAllLose, AllHeartLose);
+            EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.PlayBuffPS, PlayBuffPS);
+
         }
 
         /// <summary>

--
Gitblit v1.9.1