2025-08-27 19:56:49 +08:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace UI
|
|
|
|
{
|
2025-08-28 16:20:24 +08:00
|
|
|
public class PlayerStateUI : MonoBehaviour, Base.ITick
|
2025-08-27 19:56:49 +08:00
|
|
|
{
|
|
|
|
[SerializeField] private BarUI focusedEntityHP;
|
|
|
|
[SerializeField] private BarUI lastEntityHP;
|
2025-08-28 16:20:24 +08:00
|
|
|
|
2025-08-27 19:56:49 +08:00
|
|
|
|
|
|
|
public void Tick()
|
|
|
|
{
|
|
|
|
var focusedEntity = Program.Instance.FocusedEntity;
|
|
|
|
if (focusedEntity && focusedEntity.entityDef != null)
|
|
|
|
{
|
|
|
|
focusedEntityHP.Progress =
|
|
|
|
(float)focusedEntity.attributes.health / focusedEntity.entityDef.attributes.health;
|
|
|
|
}
|
|
|
|
}
|
2025-08-28 16:20:24 +08:00
|
|
|
|
2025-08-27 19:56:49 +08:00
|
|
|
}
|
|
|
|
}
|