19 lines
316 B
C#
19 lines
316 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class HealthBar : MonoBehaviour
|
|
{
|
|
public Slider slider;
|
|
|
|
public void SetMaxHealth(float health)
|
|
{
|
|
slider.maxValue = health;
|
|
slider.value = health;
|
|
}
|
|
|
|
public void SetHealth(float health)
|
|
{
|
|
slider.value = health;
|
|
}
|
|
}
|