先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
99 lines
3.2 KiB
C#
99 lines
3.2 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class GiftPopupPanel_8 : GiftPopupPanel
|
|
{
|
|
protected TriggerPackManager packManager;
|
|
|
|
TMP_Text txt_packName;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Transform text_title = transform.Find("root/text_title");
|
|
txt_packName = text_title?.GetComponent<TMP_Text>();
|
|
}
|
|
protected override void Start()
|
|
{
|
|
base.Start();
|
|
btn_close.onClick.AddListener(OnClickClose);
|
|
SetData();
|
|
SetTriggerPackTimer();
|
|
}
|
|
|
|
protected virtual void SetPack()
|
|
{
|
|
int vipLevel = GContext.container.Resolve<PlayerData>().PriceLv;
|
|
int packIDA = packManager.VIPPackList[vipLevel][0];
|
|
EnergyDef energyDef = _tables.TbEnergyDef.DataList[GContext.container.Resolve<PlayerData>().magnification];
|
|
int packIDB = energyDef.PackID;
|
|
if (packIDA > packIDB + 2)
|
|
{
|
|
packIDA = packIDB + 2;
|
|
}
|
|
else if (packIDA < packIDB)
|
|
{
|
|
packIDA = packIDB;
|
|
}
|
|
pack = _tables.TbPack.GetOrDefault(packIDA);
|
|
}
|
|
public void SetData()
|
|
{
|
|
int id = 4000011;
|
|
packManager = _tables.TbTriggerPackManager.GetOrDefault(id);
|
|
SetPack();
|
|
iAPItemList = _tables.TbIAPItemList.GetOrDefault(pack.IAPID);
|
|
itemDatas = GContext.container.Resolve<PlayerItemData>().GetItemDataByDropIdAndTypeLureInflation(null, pack.DropID);
|
|
SetShowData();
|
|
SKUDetailDataEvent sKUDetailDataEvent = new SKUDetailDataEvent(iAPItemList);
|
|
GContext.Publish(sKUDetailDataEvent);
|
|
text_buy.text = sKUDetailDataEvent.price;
|
|
tag_more.SetActive(pack.Rebate > 0.01);
|
|
text_best.text = LocalizationMgr.GetFormatTextValue("UI_FishingShopPanel_2", (pack.Rebate * 100).ToString("F0"));
|
|
text_time.text = ConvertTools.ConvertTime2(0, 24, 0, 0);
|
|
if (txt_packName != null)
|
|
{
|
|
txt_packName.text = LocalizationMgr.GetText(pack.Title_l10n_key);
|
|
}
|
|
}
|
|
protected override ShopBuyTypeData GetShopBuyTypeData()
|
|
{
|
|
ShopBuyTypeData shopBuyTypeData = new ShopBuyTypeData();
|
|
shopBuyTypeData.type = ShopBuyType.None;
|
|
return shopBuyTypeData;
|
|
}
|
|
|
|
protected override void OnBuySuccess()
|
|
{
|
|
OnClickClose();
|
|
}
|
|
|
|
public async void SetTriggerPackTimer()
|
|
{
|
|
DateTime dateTime = ZZTimeHelper.UtcNow().UtcNowOffset();
|
|
DateTime dateTime1 = dateTime.AddDays(1).Date;
|
|
while (this != null && dateTime.Ticks < dateTime1.Ticks)
|
|
{
|
|
TimeSpan now = dateTime1 - dateTime;
|
|
text_time.text = ConvertTools.ConvertTime2(now.Days, now.Hours, now.Minutes, now.Seconds);
|
|
await System.Threading.Tasks.Task.Delay(1000);
|
|
dateTime.AddSeconds(1);
|
|
}
|
|
if (this != null && dateTime.Ticks >= dateTime1.Ticks)
|
|
{
|
|
SetTriggerPackTimer();
|
|
}
|
|
}
|
|
|
|
protected virtual void OnClickClose()
|
|
{
|
|
UIManager.Instance.DestroyUI(UITypes.GiftPopupPanel_8);
|
|
GContext.Publish(new GiftPopupPanelEnergyEvent { isClose = true });
|
|
}
|
|
}
|