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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user