{"id":4751,"date":"2023-03-22T21:41:35","date_gmt":"2023-03-22T13:41:35","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=4751"},"modified":"2023-03-22T22:01:02","modified_gmt":"2023-03-22T14:01:02","slug":"unity%e9%85%8d%e7%bd%aeemmylua%e8%b0%83%e8%af%95","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=4751","title":{"rendered":"Unity2021\u914d\u7f6eVSCode+EmmyLua\u8c03\u8bd5"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001VSCode\u5b89\u88c5EmmyLua\u63d2\u4ef6<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u62f7EmmyLua\u7684\u6587\u4ef6\u5230\u9879\u76ee\u76ee\u5f55\u4e2d<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Users\\\u7528\u6237\u540d\\.vscode\\extensions\\tangzx.emmylua-0.5.13\\debugger\\emmy\\windows\\\n\n\u4e2d\u7684x64\u548cx86\u62f7\u5230Tool\\emmylua\\\u4e2d\n\nD:\\Project\\Assets\\\nD:\\Project\\Tool\\emmylua\\x86\\...\nD:\\Project\\Tool\\emmylua\\x64\\...<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u81f3\u542f\u52a8\u7684lua\u4e2d<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>local function startDebugger()\n    --- \u628aemmylua\u7684dll\u6240\u5728\u8def\u5f84\u6dfb\u52a0\u5230lua\u7684\u641c\u7d22\u8def\u5f84\u4e2d\u53bb\n    package.cpath = package.cpath..';.\\\\Tool\\\\emmylua\\\\x64\\\\?.dll'\n    local dbg = require(\"emmy_core\")\n    dbg.tcpConnect('localhost', 9966)\nend\n\nlocal ret, errstr = pcall(startDebugger)\nif not ret then\n    print(errstr)\nend<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001VSCode\u6dfb\u52a0\u542f\u52a8\u914d\u7f6e<\/h2>\n\n\n\n<p>\u5728  .vscode\/launch.json\u4e2d\uff0c\u914d\u7f6e emmylua<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"type\": \"emmylua_new\",\n            \"request\": \"launch\",\n            \"name\": \"EmmyLua New Debug\",\n            \"host\": \"localhost\",\n            \"port\": 9966,\n            \"ext\": [\n                \".lua\",\n                \".lua.txt\",\n                \".lua.bytes\"\n            ],\n            \"ideConnectDebugger\": false\n        },\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u5148\u542f\u52a8VSCode\uff0c\u518d\u6253\u5f00\u6e38\u620f<\/h2>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u9644\uff1aEmmyLua+C# \u8c03\u8bd5\u7684VSCode\u4e4blaunch.json\u914d\u7f6e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"type\": \"emmylua_new\",\n            \"request\": \"launch\",\n            \"name\": \"EmmyLua New Debug\",\n            \"host\": \"localhost\",\n            \"port\": 9966,\n            \"ext\": [\n                \".lua\",\n                \".lua.txt\",\n                \".lua.bytes\"\n            ],\n            \"ideConnectDebugger\": false\n        },\n        {\n            \"name\": \"Unity Editor\",\n            \"type\": \"unity\",\n            \"path\": \".\/Library\/EditorInstance.json\",\n            \"request\": \"launch\"\n        },\n    ]\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001VSCode\u5b89\u88c5EmmyLua\u63d2\u4ef6 \u4e8c\u3001\u62f7EmmyLua\u7684\u6587\u4ef6\u5230\u9879\u76ee\u76ee\u5f55\u4e2d \u4e09\u3001\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u81f3\u542f\u52a8\u7684lua [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4751"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4751"}],"version-history":[{"count":7,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4751\/revisions"}],"predecessor-version":[{"id":4759,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4751\/revisions\/4759"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}