yyl
2025-10-31 39001a600fcae2bcf27c225df8752d75fb92fef4
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];
    }
@@ -77,7 +87,7 @@
    //星上限由品质 和 觉醒决定
    //星最终上限由品质 和 觉醒决定
    public int GetMaxStarCount(int heroID, int quality)
    {
        if (HeroAwakeConfig.GetHeroAwakeConfig(heroID, 1) == null)
@@ -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;
@@ -138,7 +148,7 @@
                    }
                }
                giftBaseCells[i].Init(giftID, giftLV, null, state);
                giftBaseCells[i].Init(giftID, giftLV, state, hero.heroId, i, hero.awakeLevel);
            }
            else
            {
@@ -156,8 +166,7 @@
                }
                else
                {
                    int index = i;
                    giftBaseCells[i].Init(-1, 0, null, hero.heroId, index);
                    giftBaseCells[i].Init(-1, 0, 0, hero.heroId, i);
                }
            }
@@ -177,7 +186,7 @@
    public void ShowStarImg(int starCount, Image[] starImages, bool noStarShow = true)
    {
    {
        int imgCount = starImages.Length;
        for (int i = 0; i < imgCount; i++)
        {
@@ -205,5 +214,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);
    }
}