mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
fix(UI): 修复EntityStateBar中levelLabel的引用问题
将levelLabel的引用更新为levelLabels以匹配场景中的节点名称,并确保节点在场景树中的唯一性
This commit is contained in:
@@ -17,6 +17,7 @@ offset_right = 50.0
|
||||
offset_bottom = 5.0
|
||||
|
||||
[node name="levelLabel" type="HBoxContainer" parent="health"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.5
|
||||
|
||||
@@ -77,7 +77,7 @@ func _ready():
|
||||
health = fields.get(FieldStore.Entity.MAX_HEALTH)
|
||||
energy = fields.get(FieldStore.Entity.MAX_ENERGY) * 0.5
|
||||
if isPlayer():
|
||||
statebar.levelLabel.hide()
|
||||
statebar.levelLabels.hide()
|
||||
UIState.player = self
|
||||
hurtbox.body_entered.connect(
|
||||
func(body):
|
||||
|
||||
@@ -5,3 +5,4 @@ class_name EntityStateBar
|
||||
|
||||
@onready var healthBar: ColorBar = $"%health"
|
||||
@onready var levelLabel: Label = $"%level"
|
||||
@onready var levelLabels: HBoxContainer = $"%levelLabel"
|
||||
|
||||
Reference in New Issue
Block a user