ShantiManti/Assets/game/Scripts/UI/HealthBar.cs
2024-09-24 12:45:16 +02:00

21 lines
370 B
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;
}
}