using System; using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; public class Boxdatapanel : MonoBehaviour { /// /// 关闭箱子面板 /// public Button Offbutton; /// /// 箱子位置时间名称编号重量信息 /// public Text Positiontext, Datetext, Cigarettename, lotnumber, Upcasenumber, Upweighttext, Downcasenumber, Downweighttext; public Text Emptytext; public void Getbox(string cigarettename, string lotnumber, string Upcasenumber, string Upweighttext, string Downcasenumber, string Downweighttext, Action action) { this.Cigarettename.text = cigarettename; this.lotnumber.text = lotnumber; this.Upcasenumber.text = Upcasenumber; this.Upweighttext.text = Upweighttext; this.Downcasenumber.text = Downcasenumber; this.Downweighttext.text = Downweighttext; Offbutton.onClick.AddListener(() => { if (action != null) { action?.Invoke(); } }); } /// /// 获取箱子上面信息 /// public void Getdata(string cigare, string lotnumber, string upcase, string weight) { this.Cigarettename.text = cigare; this.lotnumber.text = lotnumber; this.Upcasenumber.text = upcase; this.Upweighttext.text = weight; } /// /// 第二层箱子信息 /// /// /// public void GetDragdown(string casen, string downeight) { Downcasenumber.text = casen; Downweighttext.text = downeight; } public void Emptydata(string empty) { Emptytext.text = empty; } /// /// 叉掉返回接口 /// public void Getoff(Action action) { Offbutton.onClick.AddListener(() => { action?.Invoke(); }); } private void Start() { } }