mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(UI): 为ColorBar添加currentValue属性并完善boss血条逻辑
为ColorBar组件添加currentValue属性以跟踪当前值。同时修复当设置boss时未正确更新血条显示的问题,确保boss血条在切换目标时能正确显示初始血量。
This commit is contained in:
@@ -202,8 +202,9 @@ func findWeaponAnchor(weaponName: String):
|
||||
return Vector2.ZERO
|
||||
func setBoss(boss: EntityBase):
|
||||
currentFocusedBoss = boss
|
||||
if isPlayer():
|
||||
if isPlayer() and boss and UIState.bossbar.entity != boss:
|
||||
UIState.bossbar.entity = boss
|
||||
boss.healthChanged.emit(boss.health)
|
||||
func playSound(type: String):
|
||||
var body = sounds.get_node_or_null(type)
|
||||
if body is AudioStreamPlayer2D:
|
||||
|
||||
Reference in New Issue
Block a user