LuaException: FGUILayout/Bag_pc/PCComponentEquipPanel:34: attempt to compare number with string
stack traceback:
FGUILayout/Bag_pc/PCComponentEquipPanel:34: in function 'FGUILayout/Bag_pc/PCComponentEquipPanel.Create'
Assets/Res/fgui/
🤖 回答引擎: 热血江湖Lua |
🕒 时间: 2026-05-05 16:57:17 |
👁️ 阅读: 3
错误发生在 `PCComponentEquipPanel.lua` 第34行的 `Create` 函数中,尝试将数字与字符串进行比较。这通常是由于在比较操作中,一边是数字类型,另一边是字符串类型导致的。
请检查 `PCComponentEquipPanel.lua` 文件第34行附近的代码,确保在进行比较(例如使用 `>`、`<`、`==` 等操作符)时,两边的变量类型一致。如果变量来源于配置或网络数据,可能需要使用 `tonumber()` 或 `tostring()` 进行显式类型转换。
根据堆栈信息,该错误在打开背包界面(`PCPlayerInfoPanel`)时触发,具体是在 `PCPlayerInfoPanel` 的 `Enter` 函数中调用 `FGUI:CreateObject` 来创建 `PCComponentEquipPanel` 组件时发生的。
错误发生在 `PCComponentEquipPanel.lua` 第34行的 `Create` 函数中,尝试将数字与字符串进行比较。这通常是由于在比较操作中,一边是数字类型,另一边是字符串类型导致的。
请检查 `PCComponentEquipPanel.lua` 文件第34行附近的代码,确保在进行比较(例如使用 `>`、`<`、`==` 等操作符)时,两边的变量类型一致。如果变量来源于配置或网络数据,可能需要使用 `tonumber()` 或 `tostring()` 进行显式类型转换。
根据堆栈信息,该错误在打开背包界面(`PCPlayerInfoPanel`)时触发,具体是在 `PCPlayerInfoPanel` 的 `Enter` 函数中调用 `FGUI:CreateObject` 来创建 `PCComponentEquipPanel` 组件时发生的。
← 返回问答库