尝试 Visual Code 调试 Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
namespace LuaTools
{
static class LuaDebugWithVsCode
{
public static void Debug()
{
IMLua luaEngine = MInterfaceMgr.singleton.GetInterface<IMLua>(MCommonFunctions.GetHash("MLua"));
if (luaEngine != null)
{
var str = string.Format(@"local func = function()
local path = ""C:/Users/mingzhewang/.vscode/extensions/tangzx.emmylua-0.5.5/debugger/emmy/windows/x64/emmy_core.dll""
package.cpath = package.cpath.."";""..path
local dbg = require(""emmy_core"")
dbg.tcpConnect(""localhost"", 9966)
end
local handle = function()
logError(""VS Code 没有开启调试 "")
end
xpcall(func, handle)");
luaEngine.DoString(str);
}
else
{
EditorUtility.DisplayDialog("LuaFast Execute Failed!", " 获取 luaEngine 失败 ", "OK");
}
}
}
}

尝试 Visual Code 调试 Lua
https://silhouettesforyou.github.io/2022/07/27/04b7f04d08ea/
Author
Xiaoming
Posted on
July 27, 2022
Licensed under