Added UI and more
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PlayerHealthView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TMP_Text healthText;
|
||||
[SerializeField] private Image healthBar;
|
||||
|
||||
public void UpdateHealth(int _currentHealth, int _maxHealth)
|
||||
{
|
||||
healthText.text = $"{_currentHealth}/{_maxHealth}";
|
||||
healthBar.fillAmount = (float)_currentHealth / _maxHealth;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user