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();