chenxin
2020-12-10 5afedf1b44f20ec1c7a27092ea37891314c83b45
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)
            {