yyl
4 天以前 ca85c0a70922aa219f6cad5e8af8ad004c3cb4b3
Main/System/Battle/UIComp/BattleHeroInfoBar.cs
@@ -150,11 +150,14 @@
    {
        KillTween(ref hpTween);
        
        float fromValue = (float)fromHp / (float)maxHp;
        float targetValue = (float)toHp / (float)maxHp;
        
        if (tween)
        {
            hpTween = sliderHp.DOValue(targetValue, 0.3f);
            // 关键修复:先设置起始值,再播放动画到目标值
            sliderHp.value = fromValue;  // ← 这行是关键!
            hpTween = sliderHp.DOValue(targetValue, 0.3f).SetAutoKill(false);
            battleObject.battleField.battleTweenMgr.OnPlayTween(hpTween);
        }
        else
@@ -170,11 +173,14 @@
    {
        KillTween(ref xpTween);
        
        float fromValue = (float)fromXp / (float)maxXp;
        float targetValue = (float)toXp / (float)maxXp;
        
        if (tween)
        {
            xpTween = sliderXp.DOValue(targetValue, 0.2f);
            // 同样的修复
            sliderXp.value = fromValue;  // ← 这行是关键!
            xpTween = sliderXp.DOValue(targetValue, 0.2f).SetAutoKill(false);
            battleObject.battleField.battleTweenMgr.OnPlayTween(xpTween);
        }
        else