备份CatanBuilding瘦身独立工程
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
using asap.core;
|
||||
using GameCore;
|
||||
using System.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class BattlePassBuyNoticePopupPanel : BasePanel
|
||||
{
|
||||
#region Field 乂
|
||||
[SerializeField]
|
||||
private Button
|
||||
btn_activate,
|
||||
btn_close;
|
||||
|
||||
[SerializeField]
|
||||
private Transform
|
||||
tran_slotParent;
|
||||
|
||||
[SerializeField]
|
||||
GameObject
|
||||
go_slot;
|
||||
|
||||
[SerializeField]
|
||||
TMP_Text
|
||||
txt_info,
|
||||
txt_title;
|
||||
|
||||
BattlePassDataProvider _dataProvider;
|
||||
#endregion
|
||||
|
||||
|
||||
#region Func
|
||||
private void Awake()
|
||||
{
|
||||
}
|
||||
protected override async void Start()
|
||||
{
|
||||
base.Start();
|
||||
btn_close.OnClickAsObservable().Subscribe(_=>Close()).AddTo(disposables);
|
||||
btn_activate.OnClickAsObservable().Subscribe(_=>ActivateBP()).AddTo(disposables);
|
||||
_dataProvider = GContext.container.Resolve<BattlePassDataProvider>();
|
||||
var curLevel = _dataProvider.Data.BattlePassRecord.Level;
|
||||
txt_title.text = LocalizationMgr.GetFormatTextValue("UI_BattlePassPanel_14", curLevel);
|
||||
txt_info.text=LocalizationMgr.GetFormatTextValue("UI_BattlePassPanel_15", curLevel);
|
||||
|
||||
go_slot.SetActive(false);
|
||||
|
||||
var slotDatas = _dataProvider.GetRewardsByLevelRange(1, curLevel, false);
|
||||
await Task.Yield();
|
||||
foreach (var data in slotDatas)
|
||||
{
|
||||
Instantiate(go_slot, tran_slotParent).GetComponent<BPItemSlot>().SetData(false,BPRewardSlot.ESlotState.Normal,data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void Close()
|
||||
{
|
||||
UIManager.Instance.DestroyUI(UITypes.BattlePassBuyNoticePopupPanel);
|
||||
}
|
||||
|
||||
async void ActivateBP()
|
||||
{
|
||||
|
||||
UIManager.Instance.DestroyUI(UITypes.BattlePassBuyNoticePopupPanel);
|
||||
|
||||
await UIManager.Instance.ShowUI(UITypes.BattlePassActivePopupPanel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user