hch
2025-09-08 4c6112ff6aa931c75d2b51591af598d4e9f008eb
Main/System/HeroUI/HeroGiftEatWin.cs
@@ -26,15 +26,9 @@
    protected override void InitComponent()
    {
        addHeroBtn.AddListener(() =>
        {
            UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
        });
        addHeroBtn.AddListener(OpenSelectWin);
        addHeroGo.AddListener(() =>
        {
            UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
        });
        addHeroGo.AddListener(OpenSelectWin);
        eatBtn.AddListener(EatHero);
    }
@@ -94,14 +88,14 @@
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
        //洗炼和觉醒的天赋未处理不可吞噬
        if (hero.talentRandomIDList.Count > 0 )
        {
        if (hero.talentRandomIDList.Count > 0)
        {
            SysNotifyMgr.Instance.ShowTip("HeroGift4");
            return;
        }
        if (hero.talentAwakeRandomIDList.Count > 0)
        {
        {
            SysNotifyMgr.Instance.ShowTip("HeroGift5");
            return;
        }
@@ -109,6 +103,22 @@
        var eatHero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectEatHeroGuid);
        if (hero == null || eatHero == null)
            return;
        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
        {
            CloseWindow();
            SysNotifyMgr.Instance.ShowTip("HeroGift7");
            return;
        }
        if (hero.IsFullStar())
        {
            CloseWindow();
            SysNotifyMgr.Instance.ShowTip("HeroGift1");
            return;
        }
        var pack = new CB231_tagCSHeroStarUP();
        pack.ItemIndex = (ushort)hero.itemHero.gridIndex;
@@ -129,4 +139,28 @@
        };
    }
    void OpenSelectWin()
    {
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
        if (hero == null)
        {
            CloseWindow();
            return;
        }
        if (hero.heroStar >= HeroUIManager.Instance.GetMaxStarCount(hero.heroId, hero.Quality))
        {
            CloseWindow();
            SysNotifyMgr.Instance.ShowTip("HeroGift7");
            return;
        }
        if (hero.IsFullStar())
        {
            CloseWindow();
            SysNotifyMgr.Instance.ShowTip("HeroGift1");
            return;
        }
        UIManager.Instance.OpenWindow<HeroGiftRoleListWin>();
    }
}