hch
2025-09-04 a11398257b98ae3cf977e22700c98735afec96ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using UnityEngine;
using UnityEngine.UI;
 
 
/// <summary>
/// 武将吞噬界面
/// </summary>
public class HeroGiftEatWin : UIBase
{
    [SerializeField] HeroShowBaseCell heroShow;
    [SerializeField] GiftBaseCell[] giftCells;
    [SerializeField] Button addHeroBtn;
    [SerializeField] GameObject addHeroGo;
    [SerializeField] HeroShowBaseCell addHeroShow;
    [SerializeField] GiftBaseCell[] addGiftCells;
    [SerializeField] GameObject addTip;
    [SerializeField] GameObject addAttrGo;
    [SerializeField] Text[] addAttrTexts;
    [SerializeField] Text addGiftTip;
 
    [SerializeField] GameObject eatBtn;
 
 
 
    string addHeroGuid;
 
    protected override void OnPreOpen()
    {
        var hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFunc);
        Display(hero);
    }
 
    protected override void OnPreClose()
    {
        addHeroGuid = "";
    }
 
 
    public void Display(HeroInfo hero)
    {
        heroShow.Init(hero.heroId, hero.SkinID, hero.breakLevel, hero.heroStar, hero.awakeLevel, hero.heroLevel);
        HeroUIManager.Instance.RefreshGiftCell(giftCells, hero);
        if (string.IsNullOrEmpty(addHeroGuid))
        {
            addHeroBtn.SetActive(true);
            addHeroGo.SetActive(false);
            addTip.SetActive(true);
            addAttrGo.SetActive(false);
        }
        else
        {
            addHeroBtn.SetActive(false);
            addHeroGo.SetActive(true);
            addTip.SetActive(false);
            addAttrGo.SetActive(true);
            var addHero = HeroManager.Instance.GetHero(addHeroGuid);
            addHeroShow.Init(addHero.heroId, addHero.SkinID, addHero.breakLevel, addHero.heroStar, addHero.awakeLevel, addHero.heroLevel);
            HeroUIManager.Instance.RefreshGiftCell(addGiftCells, addHero);
            for (int i = 0; i < addAttrTexts.Length; i++)
            {
                int id = PlayerPropertyConfig.baseAttrs[i];
                addAttrTexts[i].text = PlayerPropertyConfig.GetFullDescription(id, hero.qualityConfig.StarAddPer);
            }
            addGiftTip.SetActive(hero.IsFullGift());
        }
    }
 
}