mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-19 23:37:13 +08:00
24 lines
611 B
C#
24 lines
611 B
C#
|
|
using System;
|
||
|
|
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 && focusedEntity.entityDef != null)
|
||
|
|
{
|
||
|
|
focusedEntityHP.Progress =
|
||
|
|
(float)focusedEntity.attributes.health / focusedEntity.entityDef.attributes.health;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|