Files
test/Assets/PerfectWorld/Scripts/UI/GamePlay/UINPC.cs
T
2025-11-13 18:14:49 +07:00

29 lines
822 B
C#

using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace BrewMonster
{
public class UINPC : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI _nameText;
[SerializeField] private TextMeshProUGUI _healthText;
[SerializeField] private Image _healthImage;
// Start is called once before the first execution of Update after the MonoBehaviour is created
public void SetName(string name)
{
_nameText.text = name;
}
public void SetHealthImage(float health)
{
if(_healthImage != null)
_healthImage.fillAmount = health;
}
public void SetHealthText(string healthText)
{
if(_healthText != null)
_healthText.text = healthText;
}
}
}