28 lines
649 B
C#
28 lines
649 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class QrTextSlot : MonoBehaviour
|
|
{
|
|
[SerializeField] private Color NormalColor;
|
|
[SerializeField] private Color HighlightedColor;
|
|
|
|
|
|
[SerializeField] private Image image;
|
|
[SerializeField] private TextMeshProUGUI label;
|
|
|
|
|
|
private void OnEnable() => SetActive(false);
|
|
public void SetText(string text) => label.text = text;
|
|
public string GetText()
|
|
{
|
|
if(label.text == "")
|
|
{
|
|
label.text = " ";
|
|
}
|
|
return label.text;
|
|
}
|
|
public void SetActive(bool on) => image.color = on ? HighlightedColor : NormalColor;
|
|
|
|
}
|