12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System.Collections.Generic;
- using Core.Language;
- using Fort23.Core;
- using GameLogic.Hero;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "HeroBreakthroughSuccessPanel")]
- public partial class HeroBreakthroughSuccessPanel : UIPanel
- {
- List<HeroAttributeWidget> heroAttributeWidgets = new List<HeroAttributeWidget>();
- private void Init()
- {
- }
- protected override void AddEvent()
- {
- }
- protected override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- Btn_Close.onClick.AddListener(() => { UIManager.Instance.HideUIUIPanel(this); });
- }
- public async static CTask OpenPanel(List<HeroAttributeData> heroAttributes)
- {
- HeroBreakthroughSuccessPanel heroBreakthroughSuccessPanel = await UIManager.Instance.LoadAndOpenPanel<HeroBreakthroughSuccessPanel>(null);
- heroBreakthroughSuccessPanel.CustomInit(heroAttributes);
- }
- public async void CustomInit(List<HeroAttributeData> heroAttributes)
- {
- HeroInfo heroInfo = new HeroInfo();
- heroInfo.InitHero(PlayerManager.Instance.myHero.heroData.heroModelId, PlayerManager.Instance.myHero.heroData.heroPowerId + 1);
- Text_CurretnJIngjie.text = LanguageManager.Instance.Text(PlayerManager.Instance.myHero.powerUpConfig.jingjieLanIDs[0]) +
- LanguageManager.Instance.Text(PlayerManager.Instance.myHero.powerUpConfig.jingjieLanIDs[1]) +
- LanguageManager.Instance.Text(PlayerManager.Instance.myHero.powerUpConfig.jingjieLanIDs[2]);
- Text_NextJIngjie.text = LanguageManager.Instance.Text(heroInfo.powerUpConfig.jingjieLanIDs[0]) +
- LanguageManager.Instance.Text(heroInfo.powerUpConfig.jingjieLanIDs[1]) +
- LanguageManager.Instance.Text(heroInfo.powerUpConfig.jingjieLanIDs[2]);
- foreach (var heroAttributeData in heroAttributes)
- {
- HeroAttributeWidget heroAttributeWidget = await UIManager.Instance.CreateGComponent<HeroAttributeWidget>(null, AttributeRoot);
- heroAttributeWidget.CustomInit(heroAttributeData);
- heroAttributeWidgets.Add(heroAttributeWidget);
- }
- }
- public override void Close()
- {
- foreach (var heroAttributeWidget in heroAttributeWidgets)
- {
- UIManager.Instance.DormancyGComponent(heroAttributeWidget);
- }
- heroAttributeWidgets.Clear();
- base.Close();
- }
- }
- }
|