using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class wokePanel : ui_huodong { public Sprite icon; [Header("大的物品名的TextPro")] public TextMeshProUGUI BigNameText; [Header("物品名的TextPro")] public TextMeshProUGUI NameText; [Header("物品价格的TextPro")] public TextMeshProUGUI priceText; [Header("物品价格的详细介绍")] public Text info; private int id; public Button BuyBtn; public void initShow(int id,string iconUrl,string BigNameText,string NameText,string priceText,string info) { this.id = id; //this.icon = icon; this.BigNameText.text = BigNameText; this.NameText.text = NameText; this.priceText.text = "¥" + priceText; this.info.text = info; BuyBtn.onClick.AddListener(async()=> { await Scene_main_jiekou.instance.ShopOneItem(id); if (Scene_main_jiekou.instance.IsBuyGet) { addEventPopUp("购买成功"); } else { addEventPopUp("购买失败"); } }); } public void initShow(int id,string BigNameText, string NameText, string priceText, string info) { this.id = id; this.BigNameText.text = BigNameText; this.NameText.text = NameText; this.priceText.text = "¥"+priceText; this.info.text = info; BuyBtn.onClick.AddListener(async () => { await Scene_main_jiekou.instance.ShopOneItem(id); if (Scene_main_jiekou.instance.IsBuyGet) { addEventPopUp("购买成功"); } else { addEventPopUp("购买失败"); } }); } }