DESKTOP-FB72PO8\Administrator 1 dag sedan
förälder
incheckning
9991f022be

+ 2 - 0
Assets/Scripts/GameLogic/Combat/CombatTool/CombatCalculateTool.cs

@@ -162,6 +162,7 @@ namespace GameLogic.Combat.CombatTool
         public HarmReturnInfo Recover(CombatHeroEntity source, CombatHeroHitPoint target, long att,
             AttType attType, HarmType harmType, TriggerData triggerData)
         {
+            harmType |= HarmType.Recover;
             HarmReturnInfo harmReturnInfo = new HarmReturnInfo();
             harmReturnInfo.source = source;
             harmReturnInfo.target = target;
@@ -169,6 +170,7 @@ namespace GameLogic.Combat.CombatTool
             harmReturnInfo.attType = attType;
             harmReturnInfo.harmType = harmType;
             harmReturnInfo.triggerData = triggerData;
+            
             if (target.combatHeroEntity.isDie)
             {
                 return harmReturnInfo;

+ 22 - 21
Assets/Scripts/GameUI/UI/CombatPanel/ShowTextWidget.cs

@@ -3,6 +3,7 @@ using Common.Utility.CombatTimer;
 using Fort23.Core;
 using Fort23.UTool;
 using GameLogic.Combat.CombatTool;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
 using UnityEngine;
 
 namespace Fort23.Mono
@@ -26,29 +27,32 @@ namespace Fort23.Mono
         {
         }
 
-        public void ShowUI(CombatHeroEntity heroEntity,long att , HarmType harmType, bool isHarm)
+        public void ShowUI(CombatHeroEntity heroEntity, long att, HarmType harmType, bool isHarm)
         {
-            Vector3 worldPos =heroEntity.combatHeroGameObject.hpTransform.position;
+            Vector3 worldPos = heroEntity.combatHeroGameObject.hpTransform.position;
             Vector3 p = UIManager.Instance.CurrCustomCameraStack.camera.WorldToScreenPoint(worldPos);
             Vector3 p2 = UIManager.Instance.UICamera.ScreenToWorldPoint(p);
             transform.position = p2;
             string playName = "show";
-            switch (harmType)
+            if (harmType.HasFlag(HarmType.Shields))
             {
-                case HarmType.Default:
-                    text.color=Color.red;
-                    break;
-                case HarmType.Shields:
-                    text.color=Color.cyan;
-                    break;
-                case HarmType.Buff:
-                    playName = "buffshow";
-                    text.color=Color.white;
-                    break;
-                case HarmType.Recover:
-                    text.color=Color.green;
-                    break;
+                text.color = Color.cyan;
             }
+            else if (harmType.HasFlag(HarmType.Buff))
+            {
+                playName = "buffshow";
+                text.color = Color.white;
+            }
+            else if (harmType.HasFlag(HarmType.Recover))
+            {
+                text.color = Color.green;
+            }
+            else if (harmType.HasFlag(HarmType.Default))
+            {
+                text.color = Color.red;
+            }
+
+
             // if (isHarm)
             // {
             //     text.color=heroEntity.IsEnemy?Color.white:Color.red;
@@ -59,7 +63,7 @@ namespace Fort23.Mono
             // }
 
             text.text = att.ToString();
-            anim.Play(playName,false);
+            anim.Play(playName, false);
             // if (Animator != null)
             // {
             //     if (harmType.HasFlag(HarmType.BaoJi))
@@ -72,10 +76,7 @@ namespace Fort23.Mono
             //     }
             // }
 
-            CombatTimerManager.Instance.AddTimer(1, delegate
-            {
-                GObjectPool.Instance.Recycle(this);
-            });
+            CombatTimerManager.Instance.AddTimer(1, delegate { GObjectPool.Instance.Recycle(this); });
         }
     }
 }