From 392f839c8ddff781479e3383d9b1fd99c8ed663c Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Thu, 26 Nov 2020 11:50:02 +0800
Subject: [PATCH] 沒有配金幣掉落,然後掉落10金幣bug 過了新手還走新手關的bug

---
 Assets/Scripts/Core/Health/DamageableBehaviour.cs |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Assets/Scripts/Core/Health/DamageableBehaviour.cs b/Assets/Scripts/Core/Health/DamageableBehaviour.cs
index f7b32ef..771d3a0 100644
--- a/Assets/Scripts/Core/Health/DamageableBehaviour.cs
+++ b/Assets/Scripts/Core/Health/DamageableBehaviour.cs
@@ -1,5 +1,7 @@
 using System;
 using UnityEngine;
+using KTGMGemClient;
+using TowerDefense.Agents;
 
 namespace Core.Health
 {
@@ -54,7 +56,6 @@
         /// </summary>
         public event Action<DamageableBehaviour> died;
 
-
         /// <summary>
         /// Takes the damage and also provides a position for the damage being dealt
         /// </summary>
@@ -68,6 +69,10 @@
             info.attributeId = attributeId;
             configuration.TakeDamage(damageValue, alignment, ref info);
             var damageInfo = new HitInfo(info, damagePoint);
+            EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessAgentTaskDamage, damageInfo.healthChangeInfo.absHealthDifference);
+            if (attributeId == 0)
+                EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessOneHit);
+
             if (hit != null)
             {
                 hit(damageInfo);
@@ -114,7 +119,7 @@
         /// <summary>
         /// Fires the removed event
         /// </summary>
-        void OnRemoved()
+        protected void OnRemoved()
         {
             if (removed != null)
             {

--
Gitblit v1.9.1