From e6a2684b79e1b66844e37f99a18d17468455ee9e Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Wed, 02 Dec 2020 16:01:11 +0800
Subject: [PATCH] 修改飘字,去掉普通攻击的飘字,只飘减速和暴击

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

diff --git a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
index 6e8daf1..b0e1c03 100644
--- a/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
+++ b/Assets/Scripts/TowerDefense/UI/HUD/EndlessGameUI.cs
@@ -127,11 +127,19 @@
         public TextMoveDoTween bloodCrit;
 
         /// <summary>
+        /// 减速飘字
+        /// </summary>
+        public Image SlowDownWord;
+
+        /// <summary>
+        /// 暴击飘字
+        /// </summary>
+        public Image CritWord;
+
+        /// <summary>
         /// 购买塔防按钮上的Text.
         /// </summary>
         protected TextMeshProUGUI towerPriceText;
-
-        //protected TextMeshProUGUI towerPriceText1;
 
         protected bool tdBuyDisable = false;
 
@@ -2021,6 +2029,28 @@
             }
         }
 
+        /// <summary>
+        /// 减速飘字
+        /// </summary>
+        public void FloatSlowDownWord(Vector3 worldPos)
+        {
+            Vector3 screenPos = m_Camera.WorldToScreenPoint(worldPos);
+            GameObject obj = Instantiate(SlowDownWord.gameObject);
+            obj.GetComponent<Transform>().SetParent(GameObject.Find("MainUI/TextPanel").GetComponent<Transform>(), false);
+            obj.GetComponent<TextMoveDoTween>().FloatSlowDownWord(screenPos.x, screenPos.y);
+        }
+
+        /// <summary>
+        /// 暴击飘字
+        /// </summary>
+        public void FloatCritWord(Vector3 worldPos)
+        {
+            Vector3 screenPos = m_Camera.WorldToScreenPoint(worldPos);
+            GameObject obj = Instantiate(CritWord.gameObject);
+            obj.GetComponent<Transform>().SetParent(GameObject.Find("MainUI/TextPanel").GetComponent<Transform>(), false);
+            obj.GetComponent<TextMoveDoTween>().FloatCritWord(screenPos.x, screenPos.y);
+        }
+
         private void Start()
         {
             // 获取相应的放置区域。

--
Gitblit v1.9.1