mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-07-12 13:02:53 +08:00
fix(武器系统): 修复武器切换时UI状态不同步的问题
在武器切换时,同步更新UIState中的武器数组顺序并重建武器图标,确保UI与游戏状态一致
This commit is contained in:
@@ -77,6 +77,8 @@ func _ready():
|
|||||||
var myIndex = get_index()
|
var myIndex = get_index()
|
||||||
var rightIndex = min(myIndex + 1, get_parent().get_child_count() - 1)
|
var rightIndex = min(myIndex + 1, get_parent().get_child_count() - 1)
|
||||||
get_parent().move_child(self, rightIndex)
|
get_parent().move_child(self, rightIndex)
|
||||||
|
ArrayTool.swap(UIState.player.weapons, myIndex, rightIndex)
|
||||||
|
UIState.player.rebuildWeaponIcons()
|
||||||
)
|
)
|
||||||
for i in sounds.get_children():
|
for i in sounds.get_children():
|
||||||
i.process_mode = ProcessMode.PROCESS_MODE_ALWAYS
|
i.process_mode = ProcessMode.PROCESS_MODE_ALWAYS
|
||||||
|
|||||||
Reference in New Issue
Block a user