1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-31 00:11:54 +08:00

feat: 更新UI和角色逻辑,优化能量条显示和状态管理

This commit is contained in:
2025-08-27 20:47:04 +08:00
parent 54a4113394
commit d6cd74729b
8 changed files with 40 additions and 16 deletions
+6 -3
View File
@@ -5,7 +5,10 @@ class_name EntityStateBar
@onready var healthBar: ColorBar = $"%health"
func _physics_process(_delta):
func _ready():
if is_instance_valid(entity):
healthBar.maxValue = entity.fields.get(FieldStore.Entity.MAX_HEALTH)
healthBar.setCurrent(entity.health)
entity.healthChanged.connect(
func(health) -> void:
healthBar.maxValue = entity.fields.get(FieldStore.Entity.MAX_HEALTH)
healthBar.setCurrent(health)
)