using System; using TMPro; using UnityEngine; public class LifeMeter : MonoBehaviour { [HideInInspector] public int PlayerNumber = -1; private TextMeshProUGUI _lifeText; void Awake() { _lifeText = gameObject.GetComponent(); } public void UpdateHealth(int value) { UpdateText(value); } private void UpdateText(int value) { _lifeText.text = value.ToString(); } }