hch
2025-09-02 c5adf3e22a5cdfb185a4befc22ef0cd079a7eb33
Main/System/HeroUI/HeroTrainWin.cs
@@ -64,6 +64,13 @@
    [SerializeField] Text[] fetterNameText;   //羁绊
    //天赋
    [SerializeField] GiftBaseCell[] giftBaseCells;
    [SerializeField] Button totalGiftBtn;
    [SerializeField] Button starUPBtn;
    [SerializeField] Button washBtn;
    string guid;
    HeroInfo hero;
@@ -132,7 +139,7 @@
        hero = HeroManager.Instance.GetHero(guid);
        unfoldState = false;
        addPerObject.SetActive(false);
        Refresh();
        Display();
    }
    protected override void OnPreClose()
@@ -154,7 +161,8 @@
            }
        }
    }
    public override void Refresh()
    public void Display()
    {
        roleLhModel.Create(hero.SkinID, HeroUIManager.lihuiScale, motionName: "", isLh: true);
        roleXsModel.Create(hero.SkinID);
@@ -184,6 +192,7 @@
        RefreshAttr();
        RefreshAllPotential();
        RefreshFetter();
        RefreshGift();
    }
    void RefreshItemLockEvent(PackType type, string guid, bool lockState)
@@ -196,7 +205,7 @@
    void RefreshHeroEvent(HeroInfo hero)
    {
        Refresh();
        Display();
    }
    void RefreshConn()
@@ -230,7 +239,7 @@
        }
        guid = HeroUIManager.Instance.heroSortList[resultIndex];
        hero = HeroManager.Instance.GetHero(guid);
        Refresh();
        Display();
    }
    void ResetBtnClick()
@@ -517,7 +526,7 @@
            else
            {
                //置灰
                allAttrStr += UIHelper.AppendColor(TextColType.Gray, Language.Get("herocard63", i + 1, string.Join(Language.Get("L1112"), attrStrArr))) + "\n";
                allAttrStr += UIHelper.AppendColor(TextColType.NavyGray, Language.Get("herocard63", i + 1, string.Join(Language.Get("L1112"), attrStrArr))) + "\n";
            }
        }
@@ -563,7 +572,57 @@
                fetterText[i].SetActive(false);
            }
        }
    }
    void RefreshGift()
    {
        //传说以下只有4个
        int showCount = hero.Quality < 4 ? HeroUIManager.normalGiftMaxCnt : HeroUIManager.giftMaxCnt;
        for (int i = 0; i < giftBaseCells.Length; i++)
        {
            if (i >= showCount)
            {
                giftBaseCells[i].SetActive(false);
                continue;
            }
            giftBaseCells[i].SetActive(true);
            if (i < hero.talentIDList.Count)
            {
                int giftID = hero.talentIDList[i];
                int giftLV = hero.talentLvList[i];
                giftBaseCells[i].Init(giftID, giftLV, () =>
                {
                    var giftConfig = HeroTalentConfig.Get(giftID);
                    SmallTipWin.showText = Language.Get("SmallTipFomat", giftConfig.Name + " " + Language.Get("L1113", giftLV),
                    Language.Get("HeroGift5", PlayerPropertyConfig.Get(giftConfig.AttrID).Name, PlayerPropertyConfig.GetValueDescription(giftConfig.AttrID, giftConfig.AttrValue)));
                    SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
                    UIManager.Instance.OpenWindow<SmallTipWin>();
                });
            }
            else
            {
                if (i < HeroUIManager.normalGiftMaxCnt)
                {
                    giftBaseCells[i].Init(0, 0, () =>
                    {
                        SmallTipWin.showText = Language.Get("HeroGift1");
                        SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
                        UIManager.Instance.OpenWindow<SmallTipWin>();
                    });
                }
                else
                {
                    int index = i;
                    giftBaseCells[i].Init(-1, 0, () =>
                    {
                        SmallTipWin.showText = Language.Get("HeroGift2", HeroAwakeConfig.GetAwakeLVByUnLockGiftIndex(hero.heroId, index));
                        SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
                        UIManager.Instance.OpenWindow<SmallTipWin>();
                    });
                }
            }
        }
   }
}