1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00
Files
Dog-Lynx-And-HCN/scripts/Statemachine/BossBar.gd
T
fallingshrimp dfbacb0098 feat(UI): 为ColorBar添加currentValue属性并完善boss血条逻辑
为ColorBar组件添加currentValue属性以跟踪当前值。同时修复当设置boss时未正确更新血条显示的问题,确保boss血条在切换目标时能正确显示初始血量。
2025-08-28 07:35:34 +08:00

11 lines
317 B
GDScript

extends EntityStateBar
class_name BossBar
@onready var nameLabel: Label = $"%name"
@onready var valueLabel: Label = $"%value"
func _process(_delta):
if is_instance_valid(entity):
nameLabel.text = entity.displayName
valueLabel.text = "%.2f" % (entity.health / entity.fields[FieldStore.Entity.MAX_HEALTH] * 100)