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() { //点击按钮更新背包面板上的文字描述 btnSelf.onClick.AddListener(() => { UIManager.Instance.GetPanel().UpdateTxtInfo(nowGoods); }); } public void UpdatePanel(GoodsData goods) { nowGoods = goods; txtName.text = goods.name; txtNum.text = goods.num.ToString(); } }