using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; public class RS_LabeledComponent : MonoBehaviour { [SerializeField] protected string label; [Header("References")] [SerializeField] private TMP_Text labelText; private void OnValidate() { UpdateLabel(); } private void UpdateLabel() { if (labelText != null) { labelText.text = label; } OnUpdateLabel(); } public void SetLabel(string label) { this.label = label; UpdateLabel(); } protected virtual void OnUpdateLabel() { } }