2023-07-22 20:23:48 -07:00
|
|
|
using Godot;
|
2023-08-13 16:49:18 -07:00
|
|
|
using SupaLidlGame.Extensions;
|
2023-07-22 20:23:48 -07:00
|
|
|
|
|
|
|
namespace SupaLidlGame.UI;
|
|
|
|
|
|
|
|
public partial class HealthBar : Control
|
|
|
|
{
|
|
|
|
public TextureProgressBar ProgressBar { get; set; }
|
|
|
|
|
|
|
|
public override void _Ready()
|
|
|
|
{
|
|
|
|
ProgressBar = GetNode<TextureProgressBar>("TextureProgressBar");
|
2023-08-13 16:49:18 -07:00
|
|
|
this.GetEventBus().PlayerHealthChanged += (args) =>
|
|
|
|
{
|
|
|
|
ProgressBar.Value = args.NewHealth;
|
|
|
|
};
|
2023-07-22 20:23:48 -07:00
|
|
|
}
|
|
|
|
}
|