1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

fix(Statemachine): 修正武器随机选择时未正确处理字典值的问题

从ComponentManager.weapons字典中获取值时需要使用values()方法,以确保正确随机选择武器实例
This commit is contained in:
2026-01-18 17:16:44 +08:00
parent 3e0e8d3ff7
commit adc34fd54d
+1 -1
View File
@@ -126,7 +126,7 @@ func _ready():
for i in weaponStore.get_children():
i.free()
weaponStore.add_child(ComponentManager.getWeapon("PurpleCrystal").instantiate())
weaponStore.add_child(MathTool.randomChoiceFrom(ComponentManager.weapons).instantiate())
weaponStore.add_child(MathTool.randomChoiceFrom(ComponentManager.weapons.values()).instantiate())
for i in weaponStore.get_children():
i.hide()
weapons.append(i)