First commit

This commit is contained in:
2026-06-29 19:26:37 +09:00
commit 9efb08fdf3
11 changed files with 338 additions and 0 deletions

33
UI/HPBar.cs Normal file
View File

@@ -0,0 +1,33 @@
using Core;
namespace UI
{
public class HPBar : ComponentBase
{
private IHealthView _target;
public void Bind(IHealthView target)
{
Unbind();
_target = target;
if (_target == null) return;
_target.HPChanged += RefreshHP;
RefreshHP(target.MaxHP, target.CurrentHP);
}
public void Unbind()
{
if (_target != null) _target.HPChanged -= RefreshHP;
_target = null;
}
public void RefreshHP(int maxHP,int currentHP)
{
//UI 갱신
}
public override void OnDestroy() => Unbind();
}
}