From 00d47de2f5c810542c1668c153f47f38122a47c6 Mon Sep 17 00:00:00 2001
From: weixudong <weixudong4700@ktgame.com>
Date: Thu, 12 Nov 2020 20:23:10 +0800
Subject: [PATCH] Merge branch 'master' of ssh://172.16.1.52:8091/GemBattle into master

---
 Assets/Scripts/TowerDefense/UI/EndlessBossCtrl.cs |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/UI/EndlessBossCtrl.cs b/Assets/Scripts/TowerDefense/UI/EndlessBossCtrl.cs
index 14bc0f4..792ca26 100644
--- a/Assets/Scripts/TowerDefense/UI/EndlessBossCtrl.cs
+++ b/Assets/Scripts/TowerDefense/UI/EndlessBossCtrl.cs
@@ -26,11 +26,13 @@
 
         public Image Title;
 
+        private string titlePath = "UI/Endless/SkillTitle/";
+
         // Start is called before the first frame update
         private void Start()
         {
             ColorVal = 0;
-            EventCenter.Ins.Add((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitle, Glint);
+            EventCenter.Ins.Add<int>((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitle, Glint);
         }
 
         // Update is called once per frame
@@ -39,8 +41,9 @@
 
         }
 
-        private void Glint()
+        private void Glint(int skillType)
         {
+            Title.sprite = Resources.Load<Sprite>($"{titlePath}{skillType}");
             //设置一个DOTween队列
             Sequence flashSeq = DOTween.Sequence();
             Color c = Title.color;
@@ -54,6 +57,7 @@
             flashSeq.Append(DOTween.To(() => ColorVal, (v) => ColorVal = v, 0, 0.15f));
             flashSeq.Append(DOTween.To(() => ColorVal, (v) => ColorVal = v, 1, 0.3f));
             flashSeq.Append(DOTween.To(() => ColorVal, (v) => ColorVal = v, 0, 0.15f));
+            flashSeq.AppendCallback(() => { EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessBossSkillGlintTitleCompleted); });
         }
 
         private float ColorVal
@@ -77,6 +81,13 @@
             if (frameName == "summonEnd")
             {
                 EventCenter.Ins.BroadCast((int)EventType.EndlessBossSummonEnd);
+                // 召唤动作结束后自动切换到站立状态
+                ChangeState(EndlessBossActionState.Standing);
+            }
+            else if (frameName == "death")
+            {
+                BossAnimator.speed = 0;
+                EventCenter.Ins.BroadCast((int)EventType.EndlessBossDeathActionEnd);
             }
         }
 
@@ -86,9 +97,10 @@
         /// <param name="newState"></param>
         public void ChangeState(EndlessBossActionState newState)
         {
-            if (newState == ActionState) return;
-
             ActionState = newState;
+
+            if (newState == EndlessBossActionState.Standing || newState == EndlessBossActionState.Summon)
+                BossAnimator.speed = 1;
             BossAnimator.SetInteger("State", (int)newState);
         }
     }

--
Gitblit v1.9.1