using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class DeviceBaseInfoPanel : MonoBehaviour { public Button Offbutton; public Text Nametext, Cartext, Controlstext, Positiontext, Traytext, Operationtext, Palletnumbertext, Electriccurrenttext, Tasknumbertext, Forewarningtext, Electriccurrent, cornertext, Startingpointtext; void Start() { Offbutton.onClick.AddListener(() => { gameObject.SetActive(false); }); } public void Getdata(string Car, string Controls, string Positiont, string Tray, string Operation, string Palletnumber, string Electriccurrent, string Tasknumber, string Forewarn, string Ect, string Corner, string Starting, Action action) { this.Cartext.text = "小车" + Car; if (Controls == "1") { this.Controlstext.text = "空闲"; } else if (Controls == "2") { this.Controlstext.text = "繁忙"; } this.Palletnumbertext.text = Positiont; this.Traytext.text = Tray; if (Operation == "True") { this.Operationtext.text = "在线"; } else if (Operation == "False") { this.Operationtext.text = "离线"; } this.Palletnumbertext.text = Palletnumber; this.Electriccurrenttext.text = Electriccurrent; this.Tasknumbertext.text = Tasknumber; this.Forewarningtext.text = Forewarn; this.Electriccurrenttext.text = Ect; this.cornertext.text = Corner; this.Startingpointtext.text = Starting; Offbutton.onClick.AddListener(() => { action?.Invoke(); }); } }