1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/EntityStateBar.gd
T

15 lines
332 B
GDScript

extends Node
class_name EntityStateBar
@export var entity: EntityBase
@onready var healthBar: ColorBar = $"%health"
func _ready():
if is_instance_valid(entity):
entity.healthChanged.connect(
func(health) -> void:
healthBar.maxValue = entity.fields.get(FieldStore.Entity.MAX_HEALTH)
healthBar.setCurrent(health)
)