using AZTECHWB.Extensions; using TMPro; using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; namespace AZTECHWB { public class MachineDataInfoItem : MonoBehaviour { private Image background; private TMP_Text InfoName; private TMP_Text Data; public void Init() { background = transform.GetComponent(); transform.TryGetComponentInChildren(nameof(InfoName), out InfoName); transform.TryGetComponentInChildren(nameof(Data), out Data); } public void Setting(string tag, string info) { InfoName.text = tag; if (info == string.Empty || info == null) { Data.SetText("-"); } else { Data.SetText(info); } transform.localScale = Vector3.one; } public void SetBackgroundColor(Color color) { background.color = color; } } }