22 lines
571 B
C#
22 lines
571 B
C#
using UnityEngine;
|
|
|
|
namespace UI
|
|
{
|
|
public class PlayerStateUI : MonoBehaviour, Base.ITick
|
|
{
|
|
[SerializeField] private BarUI focusedEntityHP;
|
|
[SerializeField] private BarUI lastEntityHP;
|
|
|
|
|
|
public void Tick()
|
|
{
|
|
var focusedEntity = Program.Instance.FocusedEntity;
|
|
if (focusedEntity && focusedEntity.entityDef != null)
|
|
{
|
|
focusedEntityHP.Progress =
|
|
(float)focusedEntity.attributes.health / focusedEntity.entityDef.attributes.health;
|
|
}
|
|
}
|
|
|
|
}
|
|
} |