Files
test/Assets/PerfectWorld/Scripts/UI/GamePlay/UINPC.cs
T

40 lines
1.1 KiB
C#

using System.Collections.Generic;
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;
[Header("List Icon Task")]
[SerializeField] private GameObject _iconTaskMain;
// 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;
}
public void SetTaskIconMain(bool isShow)
{
if(_iconTaskMain != null)
_iconTaskMain.SetActive(isShow);
}
}
}