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