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:
@@ -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)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user