yyl
2025-08-29 dbb4ea01211573e782666e45eb859c96859b2cd6
125 【战斗】战斗系统 ui上的一点修正
4个文件已修改
32 ■■■■■ 已修改文件
Main/System/Battle/BattleObject/BattleObject.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/UIComp/BasicHeroInfoContainer.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/UIComp/BattleHeroInfoBar.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Team/TeamHero.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleObject/BattleObject.cs
@@ -90,7 +90,6 @@
        renderers = heroGo.GetComponentsInChildren<Renderer>(true);
        Debug.LogError("YYL---1");
        heroInfoBar = heroGo.GetComponentInChildren<BattleHeroInfoBar>(true);
        heroInfoBar.SetBattleObject(this);
    }
@@ -99,7 +98,6 @@
    public virtual void Run()
    {
        motionBase.Run();
        Debug.LogError("YYL---2");
        heroInfoBar.Run();
    }
@@ -142,6 +140,8 @@
                teamHero.maxHp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
                break;
            case PlayerDataType.XP:
                long toXp = GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
                heroInfoBar.UpdateHP(teamHero.rage, toXp, 100);
                teamHero.rage = (int)GeneralDefine.GetFactValue(_refreshInfo.Value, _refreshInfo.ValueEx);
                break;
            default:
Main/System/Battle/UIComp/BasicHeroInfoContainer.cs
@@ -1,9 +1,15 @@
using UnityEngine;
using UnityEngine.UI;
public class BasicHeroInfoContainer : MonoBehaviour
{
    public Text txtLvName;
    public Image countryIcon;
    public void SetHeroInfo(TeamHero teamHero)
    {
        txtLvName.text = string.Format("Lv.{0} {1}", teamHero.level, teamHero.name);
        countryIcon.SetSprite(HeroUIManager.Instance.GetCountryIconName((int)teamHero.Country));
    }
}
Main/System/Battle/UIComp/BattleHeroInfoBar.cs
@@ -28,6 +28,8 @@
    protected Tween hpTween;
    protected Tween xpTween;
    protected List<BattleTips> tipsList = new List<BattleTips>();
    protected List<HB428_tagSCBuffRefresh> buffList = new List<HB428_tagSCBuffRefresh>();
@@ -63,6 +65,7 @@
    protected void OnDisable()
    {
        scroller.OnRefreshCell -= OnRefreshCell;
        //  TODO YYL 考虑池化
        messages.Clear();
        for (int i = 0; i < tipsList.Count; i++)
@@ -123,6 +126,17 @@
        battleObject.battleField.battleTweenMgr.OnPlayTween(hpTween);
    }
    public void UpdateXP(long fromXp, long toXp, long maxXp)
    {
        //  做Xp增加或者减少的动画
        // sliderXp.value = ((float)fromXp) / ((float)maxXp);
        if (xpTween != null)
        {
            battleObject.battleField.battleTweenMgr.OnKillTween(xpTween);
        }
        xpTween = sliderHp.DOValue((float)toXp / maxXp, 0.2f);
        battleObject.battleField.battleTweenMgr.OnPlayTween(xpTween);
    }
    public void Run()
    {
Main/System/Team/TeamHero.cs
@@ -13,6 +13,8 @@
    public int level = 0;
    public string name;
    public TeamBase teamBase
    {
        get; private set;
@@ -53,6 +55,8 @@
            Country = (HeroCountry)heroConfig.Country;
            SkinID = (int)fightObj.SkinID;
            modelScale = 1f;
            name = heroConfig.Name;
        }
        else if (fightObj.NPCID > 0)
        {
@@ -61,6 +65,8 @@
            Country = (HeroCountry)npcConfig.Country;
            SkinID = npcConfig.SkinID;
            modelScale = npcConfig.ModelScale;
            name = npcConfig.NPCName;
        }
        else
        {