CultivateImmortal/Assets/Scripts/GameObject/BtnMaterial.cs

31 lines
660 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using System.Xml.Linq;
using UnityEngine;
using UnityEngine.UI;
public class BtnMaterial : MonoBehaviour
{
public Button btnSelf;
public Text txtName;
public Text txtNum;
private GoodsData nowGoods;
void Start()
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD>±<EFBFBD><C2B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
btnSelf.onClick.AddListener(() =>
{
UIManager.Instance.GetPanel<BagPanel>().UpdateTxtInfo(nowGoods);
});
}
public void UpdatePanel(GoodsData goods)
{
nowGoods = goods;
txtName.text = goods.name;
txtNum.text = goods.num.ToString();
}
}