36 lines
787 B
C#
36 lines
787 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace AZTECHWB
|
|
{
|
|
public class UI_SimulationInfoItem : MonoBehaviour
|
|
{
|
|
public TMP_Text InfoName;
|
|
public TMP_Text Data;
|
|
|
|
public void Init()
|
|
{
|
|
var textDict = transform.GetChildComponentsByName<TextMeshProUGUI>();
|
|
|
|
InfoName = textDict.GetOrNull(nameof(InfoName));
|
|
Data = textDict.GetOrNull(nameof(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;
|
|
}
|
|
}
|
|
}
|
|
|