yyl
2025-09-15 bb5909bcd36b48b919366c95b4248a3754452698
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
69
70
71
72
73
74
75
76
77
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
 
 
/// <summary>
/// 武将吞噬成功界面
/// </summary>
public class HeroGiftEatSuccessWin : UIBase
{
 
    [SerializeField] Image[] beforeStars;
    [SerializeField] Image[] afterStars;
    [SerializeField] Text[] attrPerNameArr;
    [SerializeField] Text[] attrPerTextArr;
    [SerializeField] Text[] nextAttrPerTextArr;
    [SerializeField] GiftBaseCell[] giftBaseCellArr;
    [SerializeField] Button okBtn;
 
    //角色
    [SerializeField] Image taiziBG;
    [SerializeField] UIHeroController heroModel;
    [SerializeField] Text nameText;
 
 
    protected override void InitComponent()
    {
        okBtn.AddListener(CloseWindow);
    }
 
 
    protected override void OnPreOpen()
    {
        if (string.IsNullOrEmpty(HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin))
            return;
        Display();
        HeroUIManager.Instance.selectEatHeroGuid = "";
    }
 
 
    public void Display()
    {
        HeroInfo hero = HeroManager.Instance.GetHero(HeroUIManager.Instance.selectHeroGuidForGiftFuncForSuccessWin);
        if (hero == null)
            return;
 
        int beforeStarCount = hero.heroStar - 1;
        int afterStarCount = hero.heroStar;
 
        HeroUIManager.Instance.ShowStarImg(beforeStarCount, beforeStars);
        HeroUIManager.Instance.ShowStarImg(afterStarCount, afterStars);
 
 
        //上阵属性
        int valuePer = hero.GetOnBattleAddPer();
        for (int i = 0; i < attrPerTextArr.Length; i++)
        {
            int id = PlayerPropertyConfig.basePerAttrs[i];
            attrPerNameArr[i].text = PlayerPropertyConfig.Get(id).Name;
            nextAttrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(id, valuePer);
            attrPerTextArr[i].text = PlayerPropertyConfig.GetValueDescription(id, valuePer - hero.qualityConfig.StarAddPer);
        }
 
        //天赋
        HeroUIManager.Instance.RefreshGiftCell(giftBaseCellArr, hero, HeroUIManager.Instance.heroBeforeGiftIDList,
         HeroUIManager.Instance.heroBeforeGiftLevelList);
 
        var heroConfig = hero.heroConfig;
 
        taiziBG.SetSprite("herodz" + heroConfig.Quality);
        heroModel.Create(hero.SkinID, heroConfig.UIScale);
        nameText.text = hero.breakLevel == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, hero.breakLevel);
        nameText.color = UIHelper.GetUIColorByFunc(heroConfig.Quality);
    }
 
}