From e828d3c14c03d86a77a12cf184c547257c08f849 Mon Sep 17 00:00:00 2001 From: GL <2365963573@qq.com> Date: Thu, 2 Jan 2025 18:04:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Role/Fun.cs | 11 +++++++++-- Role/Role.cs | 9 +++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Role/Fun.cs b/Role/Fun.cs index 9c5b84e..6a26c41 100644 --- a/Role/Fun.cs +++ b/Role/Fun.cs @@ -83,8 +83,15 @@ public class Fun : Base - - targetAudience.Hp -= finalDamage; + if (targetAudience.Hp- finalDamage<0) + { + targetAudience.Hp = 0; + } + else + { + targetAudience.Hp -= finalDamage; + } + if (targetAudience.Hp<=0&&targetAudience.HaveDieTime==1) { diff --git a/Role/Role.cs b/Role/Role.cs index 6246857..7cd0052 100644 --- a/Role/Role.cs +++ b/Role/Role.cs @@ -92,10 +92,10 @@ public class Role : Fun // 使用 DOTween 动画平滑过渡血条填充 DOTween.To(() => HpfiilYello.fillAmount, x => HpfiilYello.fillAmount = x, hp / maxHp, 0.8f) // 0.5f 为过渡时间 .SetEase(Ease.InOutQuad); // 使用缓动效果,使血条变化更加平滑 - //if (UIContorl.instance.NowShowInfo!=null&&UIContorl.instance.NowShowInfo.Id == 1) - //{ - // UIContorl.instance.NowShowInfo.UpDateShow("1", "Enemy_001", "0", "3", "1", "测试文档一", hp, maxHp); - //} + if (UIContorl.instance.NowShowInfo != null && UIContorl.instance.NowShowInfo.Id == 1 && this == UIContorl.instance.NowShowInfo.role) + { + UIContorl.instance.NowShowInfo.UpDateShow("1", "Enemy_001", "0", "3", "1", "测试文档一", hp, maxHp); + } } // 更新血量文本效果 @@ -325,6 +325,7 @@ public class Role : Fun if (Application.isPlaying) { + GetComponent().HideInfoPanel(); animationHighlight = dieIndex; Navigation.PauseAnimation();