24 lines
398 B
C#
24 lines
398 B
C#
using System;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class LifeMeter : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public int PlayerNumber = -1;
|
|
private TextMeshProUGUI _lifeText;
|
|
|
|
void Awake()
|
|
{
|
|
_lifeText = gameObject.GetComponent<TextMeshProUGUI>();
|
|
}
|
|
|
|
public void UpdateHealth(int value)
|
|
{
|
|
UpdateText(value);
|
|
}
|
|
private void UpdateText(int value)
|
|
{
|
|
_lifeText.text = value.ToString();
|
|
}
|
|
} |