21 lines
523 B
C#
21 lines
523 B
C#
using TMPro;
|
|
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)
|
|
{
|
|
focusedEntityHP.Progress = (float)focusedEntity.attributes.health/focusedEntity.entityDef.attributes.health;
|
|
}
|
|
}
|
|
}
|
|
} |