doc/unreal/zhcn/vscode_debug.md
//8080是调试端口
GameScript = MakeShared<puerts::FJsEnv>(std::make_unique<puerts::DefaultJSModuleLoader>(TEXT("JavaScript")), std::make_shared<puerts::FDefaultLogger>(), 8080);
GameScript = MakeShared<puerts::FJsEnv>(std::make_unique<puerts::DefaultJSModuleLoader>(TEXT("JavaScript")), std::make_shared<puerts::FDefaultLogger>(), 8080);
GameScript->WaitDebugger();
//...
GameScript->Start("QuickStart", Arguments);
开启”继承引擎类功能“后,系统会启动一个默认的虚拟机,该虚拟机通过配置界面来设置调试端口
vscode下打开setting,搜索auto attach,将Debug>Node:Auto Attach设置为“on”(高版本vscode没有该选项,可以不设置)
菜单打开“编辑->编辑器偏好设置”页面,在“通用->性能”中把“处于背景中时占用较少CPU”的勾选去掉,否则debug连接会很慢