projectEli/Assets/Inventory System/Scripts/Helpers/RenderItemUIProperty.cs

36 lines
864 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
namespace SimpleInventorySystem
{
public class RenderItemUIProperty : MonoBehaviour
{
public TextMeshProUGUI textMeshProUGUI;
[HideInInspector] public string value;
// Start is called before the first frame update
void Start()
{
}
public void Hide()
{
if (textMeshProUGUI != null)
textMeshProUGUI.enabled = false;
}
public void Show()
{
if (textMeshProUGUI != null)
textMeshProUGUI.enabled = true;
}
// Update is called once per frame
void Update()
{
if(textMeshProUGUI != null && textMeshProUGUI.enabled)
textMeshProUGUI.text = value;
}
}
}