mirror of
https://github.com/Kizuren/ShantiManti.git
synced 2025-12-28 01:54:27 +01:00
21 lines
370 B (Stored with Git LFS)
C#
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;
|
|
}
|
|
}
|