1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using System.Collections.Generic;
- using Excel2Json;
- using GameLogic.Bag;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "SummonScoreAwardWidget")]
- public partial class SummonScoreAwardWidget : UIComponent
- {
- List<WidgetItem> _widgetItems = new List<WidgetItem>();
- public OpenBoxProgressReward _openBoxProgressReward = new OpenBoxProgressReward();
- private Action lingquCallBack;
- private void Init()
- {
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- Btn_LingQu.onClick.AddListener(() =>
- {
- lingquCallBack?.Invoke();
- Btn_LingQu.gameObject.SetActive(false);
- });
- }
- public async void CustomInit(OpenBoxProgressReward openBoxProgressReward,Action lingquCallBack)
- {
- this.lingquCallBack = lingquCallBack;
- _openBoxProgressReward = openBoxProgressReward;
- Text_Name.text = $"累计达到 {openBoxProgressReward.TotalScore}";
- for (var i = 0; i < openBoxProgressReward.PrizeID.Length; i++)
- {
- WidgetItem widgetItem = await UIManager.Instance.CreateGComponent<WidgetItem>(null, ItemRoot);
- widgetItem.InitWidget(new ItemInfo(openBoxProgressReward.PrizeID[i], openBoxProgressReward.PrizeCount[i]));
- _widgetItems.Add(widgetItem);
- }
- }
- public override void DormancyObj()
- {
- foreach (var widgetItem in _widgetItems)
- {
- UIManager.Instance.DormancyGComponent(widgetItem);
- }
- _widgetItems.Clear();
-
- Icon_Select.gameObject.SetActive(false);
- Btn_LingQu.gameObject.SetActive(false);
- base.DormancyObj();
- }
- }
- }
|