先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
57 lines
2.1 KiB
C#
57 lines
2.1 KiB
C#
using System;
|
|
using asap.core;
|
|
using GameCore;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UniRx;
|
|
using cfg;
|
|
|
|
public class BlackFridayCouponPopupPanel : MonoBehaviour
|
|
{
|
|
[SerializeField] private Button btnClose, btnClaim;
|
|
[SerializeField] private TMP_Text textTimer, textInfo, textTitle;
|
|
[SerializeField] private Image bg;
|
|
private BlackFridayCouponData _data;
|
|
private void Start()
|
|
{
|
|
btnClose.onClick.AddListener(OnClickClose);
|
|
_data = GContext.container.Resolve<PlayerShopData>().CouponData;
|
|
if (_data is not {IsActive: true})
|
|
{
|
|
UIManager.Instance.DestroyUI(UITypes.BlackFridayPopupPanel);
|
|
}
|
|
var couponUiData = GContext.container.Resolve<Tables>().TbEventCoupon[_data.RedirectId];
|
|
textTitle.text = LocalizationMgr.GetText(couponUiData.Title_l10n_key);
|
|
GContext.container.Resolve<IUIService>().SetImageSprite(bg, couponUiData.BgBanner);
|
|
textTimer.text = ConvertTools.ConvertTime2(_data.RemainingTime);
|
|
Observable.Interval(TimeSpan.FromSeconds(1.0f))
|
|
.Subscribe(_ =>
|
|
{
|
|
textTimer.text = ConvertTools.ConvertTime2(_data.RemainingTime);
|
|
if (!_data.IsActive)
|
|
{
|
|
UIManager.Instance.DestroyUI(UITypes.BlackFridayPopupPanel);
|
|
}
|
|
})
|
|
.AddTo(this);
|
|
textInfo.text = LocalizationMgr.GetFormatTextValue("UI_GiftPopupPanel_13_3", _data.Multiplier + "%");
|
|
btnClaim.onClick.RemoveAllListeners();
|
|
btnClaim.onClick.AddListener(OnClickBuy);
|
|
}
|
|
|
|
private void OnClickClose()
|
|
{
|
|
UIManager.Instance.DestroyUI(UITypes.BlackFridayPopupPanel);
|
|
}
|
|
|
|
private async void OnClickBuy()
|
|
{
|
|
GContext.container.Resolve<IFaceUIService>().StopFaceUI();
|
|
await UIManager.Instance.ShowUI(UITypes.FishingShopPanel);
|
|
GContext.Publish(new LackOfResourceConfirmEvent() { state = 1 });
|
|
UIManager.Instance.DestroyUI(UITypes.BlackFridayPopupPanel);
|
|
GContext.Publish(new HideHomePanelEvent());
|
|
}
|
|
}
|