_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Scene_shop/wokePanel.cs

67 lines
1.8 KiB
C#
Raw Normal View History

2024-11-27 22:22:41 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2024-11-28 00:39:35 +08:00
using UnityEngine.UI;
using TMPro;
2024-11-27 22:22:41 +08:00
public class wokePanel : ui_huodong
{
2024-11-28 05:52:04 +08:00
2024-11-28 00:39:35 +08:00
public Sprite icon;
[Header("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>TextPro")]
public TextMeshProUGUI BigNameText;
[Header("<22><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>TextPro")]
public TextMeshProUGUI NameText;
[Header("<22><>Ʒ<EFBFBD>۸<EFBFBD><DBB8><EFBFBD>TextPro")]
public TextMeshProUGUI priceText;
[Header("<22><>Ʒ<EFBFBD>۸<EFBFBD><DBB8><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>")]
public Text info;
2024-11-28 05:52:04 +08:00
private int id;
2024-11-28 00:39:35 +08:00
2024-11-28 05:52:04 +08:00
public Button BuyBtn;
2024-11-28 00:39:35 +08:00
2024-11-28 05:52:04 +08:00
public void initShow(int id,string iconUrl,string BigNameText,string NameText,string priceText,string info)
2024-11-28 00:39:35 +08:00
{
2024-11-28 05:52:04 +08:00
this.id = id;
//this.icon = icon;
2024-11-28 02:00:05 +08:00
this.BigNameText.text = BigNameText;
this.NameText.text = NameText;
this.priceText.text = "<22><>" + priceText;
this.info.text = info;
2024-11-28 05:52:04 +08:00
BuyBtn.onClick.AddListener(async()=> {
await Scene_main_jiekou.instance.ShopOneItem(id);
if (Scene_main_jiekou.instance.IsBuyGet)
{
addEventPopUp("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>");
}
else
{
addEventPopUp("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>");
}
});
2024-11-28 00:39:35 +08:00
}
2024-11-28 05:52:04 +08:00
public void initShow(int id,string BigNameText, string NameText, string priceText, string info)
2024-11-28 00:39:35 +08:00
{
2024-11-28 05:52:04 +08:00
this.id = id;
2024-11-28 00:39:35 +08:00
this.BigNameText.text = BigNameText;
this.NameText.text = NameText;
this.priceText.text = "<22><>"+priceText;
this.info.text = info;
2024-11-28 05:52:04 +08:00
BuyBtn.onClick.AddListener(async () => {
await Scene_main_jiekou.instance.ShopOneItem(id);
if (Scene_main_jiekou.instance.IsBuyGet)
{
addEventPopUp("<22><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>");
}
else
{
addEventPopUp("<22><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>");
}
});
2024-11-28 00:39:35 +08:00
}
2024-11-27 22:22:41 +08:00
}