先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
74 lines
1.8 KiB
C#
74 lines
1.8 KiB
C#
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
|
|
}
|