1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-09 05:07:12 +08:00

feat(UI): 为ColorBar添加currentValue属性并完善boss血条逻辑

为ColorBar组件添加currentValue属性以跟踪当前值。同时修复当设置boss时未正确更新血条显示的问题,确保boss血条在切换目标时能正确显示初始血量。
This commit is contained in:
2025-08-28 07:35:34 +08:00
parent ef03aa2922
commit dfbacb0098
3 changed files with 4 additions and 4 deletions
+1 -3
View File
@@ -4,9 +4,7 @@ class_name BossBar
@onready var nameLabel: Label = $"%name"
@onready var valueLabel: Label = $"%value"
func _ready():
if is_instance_valid(entity):
nameLabel.text = entity.displayName
func _process(_delta):
if is_instance_valid(entity):
nameLabel.text = entity.displayName
valueLabel.text = "%.2f" % (entity.health / entity.fields[FieldStore.Entity.MAX_HEALTH] * 100)