Files
MinFt/Client/Assets/Scripts/UI/Shop/GiftBargainInfoPopupPanel.cs
Liubing\LB 3d8d4d18f3 first commit
先修复一下,错误的场景

删除不必要的钓场资产

修复into场景

update:更新meta文件,修复报错

update:修复资源

修复第一章节建造

修复建造第三章

update:删除多余内容

update:更新README.md

update:还原图标

update:更新README

update:更新配置
2026-04-28 02:17:22 +08:00

55 lines
2.5 KiB
C#

using UnityEngine.UI;
using System.Collections.Generic;
using TMPro;
using asap.core;
using GameCore;
using cfg;
public class GiftBargainInfoPopupPanel : BasePanel
{
private List<Image> _itemIcons;
private List<TMP_Text> _itemTexts;
private Image _progressBar;
private TMP_Text _textProgress, _textInfo, _textTagInfo;
private IUIService _uiService;
private BargainPackData _bpd;
private Button _btnClose;
private readonly Tables _tables = GContext.container.Resolve<Tables>();
private void Awake()
{
_itemIcons = new List<Image>();
_itemTexts = new List<TMP_Text>();
for (int i = 1; i <= 3; i++)
{
_itemIcons.Add(transform.Find($"root/info1/item/item{i}/icon_tag").GetComponent<Image>());
_itemTexts.Add(transform.Find($"root/info1/item/item{i}/text_num").GetComponent<TMP_Text>());
}
_progressBar = transform.Find("root/info2/bg_bar/bar").GetComponent<Image>();
_textProgress = transform.Find("root/info2/bg_bar/text_progress").GetComponent<TMP_Text>();
_uiService = GContext.container.Resolve<IUIService>();
_bpd = GContext.container.Resolve<BargainPackData>();
_btnClose = transform.Find("btn_close").GetComponent<Button>();
_textInfo = transform.Find("root/info3/text_num").GetComponent<TMP_Text>();
_textTagInfo = transform.Find("root/info2/tag/tag_1/text_num").GetComponent<TMP_Text>();
}
protected override void Start()
{
_btnClose.onClick.AddListener(() =>
{ UIManager.Instance.DestroyUI(UITypes.GiftBargainInfoPopupPanel); });
for (int i = 0; i < _itemIcons.Count; i++)
{
_uiService.SetImageSprite(_itemIcons[i], $"icon_fish_rate_tag_{i + 3}");
_itemTexts[i].text = "+" + _bpd.FishingScoreList[i + 2].ToString();
}
int target = _tables.TbSpecialPack[_tables.TbEventPackManager[_bpd.RedirectID].VIPPackList[0][0]].EventItemRequire[1];
PlayerItemData playerItemData = GContext.container.Resolve<PlayerItemData>();
target = playerItemData.IntInflation(target, _bpd.Inflation);
_textProgress.text = $"{target / 2}/{target}";
_progressBar.fillAmount = 0.5f;
_textInfo.text = $"{_tables.TbSpecialPack[_tables.TbEventPackManager[_bpd.RedirectID].VIPPackList[0][0]].DiscountList[^1]}%";
_textTagInfo.text = $"{_tables.TbSpecialPack[_tables.TbEventPackManager[_bpd.RedirectID].VIPPackList[0][0]].DiscountList[2]}%";
base.Start();
}
}