hch
2025-09-06 9216ab7322fa164abaa6f9089058746b34bd690a
Main/System/HeroUI/HeroUIManager.Talent.cs
@@ -38,7 +38,11 @@
        }
    }
    #region 洗炼
    public string selectWashHeroGUID; //被洗练武将GUID
    public Action changeLockEvent;
    #endregion
    public List<string> heroEatList = new List<string>();
@@ -60,7 +64,13 @@
    //根据天赋锁状态获取消耗的材料数量
    public int GetTalentLockUseWashCount(HeroInfo hero)
    {
        return washByLockUseCounts[hero.GetTalentLockCount()];
        int heroTalentLockCount = hero.GetTalentLockCount();
        //不够取最后一个
        if (heroTalentLockCount >= washByLockUseCounts.Length)
        {
            heroTalentLockCount = washByLockUseCounts.Length - 1;
        }
        return washByLockUseCounts[heroTalentLockCount];
    }
@@ -98,7 +108,7 @@
    //beforeGiftIDList用于对比变化的天赋格子
    public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero, List<int> beforeGiftIDList= null, List<int> beforeGiftLevelList= null)
    public void RefreshGiftCell(GiftBaseCell[] giftBaseCells, HeroInfo hero, List<int> beforeGiftIDList = null, List<int> beforeGiftLevelList = null)
    {
        int showCount = GetGiftGirdMaxCount(hero.heroId);
        for (int i = 0; i < giftBaseCells.Length; i++)
@@ -117,7 +127,7 @@
                int state = 0; //0:不显示 1:新增 2:提升
                if (!beforeGiftIDList.IsNullOrEmpty())
                {
                {
                    if (i >= beforeGiftIDList.Count)
                    {
                        state = 1;
@@ -177,7 +187,7 @@
    public void ShowStarImg(int starCount, Image[] starImages, bool noStarShow = true)
    {
    {
        int imgCount = starImages.Length;
        for (int i = 0; i < imgCount; i++)
        {
@@ -205,5 +215,24 @@
            }
        }
    }
    // public ushort ItemIndex;    //武将物品所在武将背包位置索引
    // public byte LockCnt;
    // public  byte[] LockTalentIndexs;    //锁定天赋索引列表
    // public byte OPType;    // 操作类型:0-执行洗炼;1-替换原天赋;2-保留原天赋
    public void SendWash(HeroInfo hero, byte opType)
    {
        var pack = new CB235_tagCSHeroWash();
        pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
        pack.LockCnt = (byte)hero.talentLockList.Count;
        pack.LockTalentIndexs = new byte[pack.LockCnt];
        for (int i = 0; i < pack.LockCnt; i++)
        {
            pack.LockTalentIndexs[i] = (byte)hero.talentLockList[i];
        }
        pack.OPType = opType;
        GameNetSystem.Instance.SendInfo(pack);
    }
}