Files
SAMKWANG/Assets/Scripts/Branch/UI/UI_MachineDataInfoItem.cs

38 lines
841 B
C#

using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
namespace Samkwang
{
public class UI_MachineDataInfoItem : 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;
}
}
}