| | |
| | | |
| | | 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); |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | |
| | | }; |
| | | } |
| | | |
| | | 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>(); |
| | | } |
| | | } |