Scriptum/Assets/Scripts/HealthBar.cs
2022-06-12 20:14:11 +02:00

21 lines
400 B
C#

using System.Collections;
using System.Collections.Generic;
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;
}
}