Unity + XLua + VS Code断点调试 之 luaPanda (免费版本调试)
文档:https://github.com/Tencent/LuaPanda/blob/master/Docs/Manual/quick-use.md
文档已经够详细了,我这里既不多说什么了,我就说说自己在弄这个luapanda遇到的问题,防止大家走弯路!
很详细每步细狗教程:https://blog.csdn.net/wodownload2/article/details/122344768
步骤1: vscode 里面下载 luapanda
2: 重启一下vscode
3: 去官网下载debug那个文件夹
4:放到自己项目中
5: 跟着官方文档走 over.
注意事项:
项目记得加入这行代码来运行LuaPanda调试
require("LuaPanda").start("127.0.0.1",8888)
建议加在需要调试的脚本中,亲测加入首个运行脚本中,导致项目非常的卡。
有问题请留言!
补充: 在根目录下的.vscode目录下添加 launch.json文件
{
"version": "0.2.0",
"configurations": [
{
"type": "lua",
"request": "launch",
"name": "LuaPanda",
"program": "",
"cwd": "${workspaceFolder}",
"luaFileExtension": ".lua",
"connectionPort": 8888,
"pathCaseSensitivity": true,
"stopOnEntry": false,
"useCHook": true,
"autoPathMode": true,
"logLevel": 1
},
{
"type": "lua",
"request": "launch",
"name": "LuaPanda-Attach"
},
{
"type": "lua",
"request": "launch",
"name": "LuaPanda-DebugFile",
"luaPath": "",
"packagePath": [],
"luaFileExtension": ".lua",
"connectionPort": 8888,
"stopOnEntry": false,
"useCHook": true,
"logLevel": 1
}
]
}