77 lines
2.2 KiB
C#
77 lines
2.2 KiB
C#
using System;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Boxdatapanel : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 关闭箱子面板
|
|
/// </summary>
|
|
public Button Offbutton;
|
|
/// <summary>
|
|
/// 箱子位置时间名称编号重量信息
|
|
/// </summary>
|
|
public Text Positiontext, Datetext, Cigarettename, lotnumber, Upcasenumber, Upweighttext, Downcasenumber, Downweighttext;
|
|
public Text Emptytext;
|
|
public void Getbox(string postition, string datetext, string cigarettename, string lotnumber, string Upcasenumber, string Upweighttext, string Downcasenumber, string Downweighttext, Action action)
|
|
{
|
|
this.Positiontext.text = postition;
|
|
this.Datetext.text = datetext;
|
|
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();
|
|
}
|
|
});
|
|
}
|
|
/// <summary>
|
|
/// 获取箱子上面信息
|
|
/// </summary>
|
|
public void Getdata(string postition, string datetext,string cigare, string lotnumber, string upcase, string weight)
|
|
{
|
|
this.Positiontext.text = postition;
|
|
this.Datetext.text = datetext;
|
|
this.Cigarettename.text = cigare;
|
|
this.lotnumber.text = lotnumber;
|
|
this.Upcasenumber.text = upcase;
|
|
this.Upweighttext.text = weight;
|
|
}
|
|
/// <summary>
|
|
/// 第二层箱子信息
|
|
/// </summary>
|
|
/// <param name="casen"></param>
|
|
/// <param name="downeight"></param>
|
|
public void GetDragdown(string casen, string downeight)
|
|
{
|
|
Downcasenumber.text = casen;
|
|
Downweighttext.text = downeight;
|
|
}
|
|
public void Emptydata(string empty)
|
|
{
|
|
Emptytext.text = empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 叉掉返回接口
|
|
/// </summary>
|
|
public void Getoff(Action action)
|
|
{
|
|
Offbutton.onClick.AddListener(() =>
|
|
{
|
|
action?.Invoke();
|
|
});
|
|
}
|
|
private void Start()
|
|
{
|
|
|
|
}
|
|
}
|