ShantiManti/Assets/game/Scripts/UI/HealthBar.cs
2024-04-28 13:51:52 +02:00

21 lines
370 B (Stored with Git LFS)
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HealthBar : MonoBehaviour
{
public PlayerHealth playerHealth;
public Slider slider;
void Start()
{
slider.maxValue = playerHealth.health;
}
// Update is called once per frame
void Update()
{
slider.value = playerHealth.health;
}
}