You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
650 B

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()
{
}
}