1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-01 17:01:53 +08:00

fix(武器系统): 修复武器切换时UI状态不同步的问题

在武器切换时,同步更新UIState中的武器数组顺序并重建武器图标,确保UI与游戏状态一致
This commit is contained in:
2025-09-21 21:59:14 +08:00
parent a12c201880
commit 034c98654a
+2
View File
@@ -77,6 +77,8 @@ func _ready():
var myIndex = get_index()
var rightIndex = min(myIndex + 1, get_parent().get_child_count() - 1)
get_parent().move_child(self, rightIndex)
ArrayTool.swap(UIState.player.weapons, myIndex, rightIndex)
UIState.player.rebuildWeaponIcons()
)
for i in sounds.get_children():
i.process_mode = ProcessMode.PROCESS_MODE_ALWAYS