| | |
| | | |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | | pack.UseItemIndex = (ushort)eatHero.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>(); |
| | | } |
| | | } |