mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 00:58:59 -05:00
15 lines
297 B
C#
15 lines
297 B
C#
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
using UnityAtoms;
|
||
|
|
||
|
public class HealthBar : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField]
|
||
|
private IntConstant MaxHealth = null;
|
||
|
|
||
|
public void HealthChanged(int health)
|
||
|
{
|
||
|
GetComponent<Image>().fillAmount = 1.0f * health / MaxHealth.Value;
|
||
|
}
|
||
|
}
|