1. Install Visual Studio Code (vscode) and plug-in center search and install luaide
2. Configure luach.json
1. Drag the project folder directly into vscode
2. Debug icon in the left column -> Settings -> select LuaDebug, then the launch.json file will appear
3. Find the exePath field in the launch.json file and modify it to the simulator path
例如:"exePath": "D:/xxx/player-3.x/player3.exe",
Other places can be configured by default.
Three.lua breakpoint debugging configuration
1. Download the file LuaDebug.lua
Address: https://github.com/k0204/LuaIde
2. Put the LuaDebug.lua file in the project src directory
3. Add debugging code
Add the following code in the main.lua file:
local breakInfoFun,xpcallFun = require("LuaDebug")("localhost", 7003)
Author: fjxiao
link: https: //www.jianshu.com/p/61152eeee4cc
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.