using TMPro; using UnityEngine; namespace UI { public class TextUIComponent : UIComponentBase { [SerializeField] private TMP_Text _text; private string _initialText; private void Awake() => _initialText = _text.text; public void SetText(string newText) => _text.text = string.IsNullOrEmpty(newText) ? string.Empty : newText; public void ResetText() => _text.text = _initialText; public void AddText(string textToAdd) => _text.text += textToAdd; public void HideText() => _text.text = string.Empty; } }