{"id":5831,"date":"2024-08-30T22:28:16","date_gmt":"2024-08-30T14:28:16","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=5831"},"modified":"2024-08-30T22:55:55","modified_gmt":"2024-08-30T14:55:55","slug":"emmylua%e8%b0%83%e8%af%95%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=5831","title":{"rendered":"Emmylua\u8c03\u8bd5Lua\u8bb0\u5f55"},"content":{"rendered":"\n<p>\u8d77\u56e0\uff1a<\/p>\n\n\n\n<p>Emmylua\u53ef\u4ee5\u7528\u4e8eUnity\u5f00\u53d1\u4e0e\u8c03\u8bd5\uff0c\u5982\u679c\u4e0d\u7528Unity+XLua<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>local dbg = require('emmy_core') \nprint(\"emmylua=\" .. tostring(dbg))\nlocal ret = dbg.tcpListen('127.0.0.1',9988)\nprint(\"listen=\"..tostring(ret))<\/code><\/pre>\n\n\n\n<p>\u81ea\u5df1\u7528\u5b98\u65b9\u7684Lua 5.3.5\u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u811a\u672c\uff0c\u53d1\u73b0\u65e0\u6cd5\u542f\u52a8\u8c03\u8bd5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Unity+XLua+VSCode\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f1a\u8f93\u51fa\nemmylua=xxxxxxx\nlisten=true\n\n\u4f46\u662f\u7528Lua+VSCode\uff0c\u4f1a\u8f93\u51fa\nemmylua=true<\/code><\/pre>\n\n\n\n<p>\u5728Github\u4e0a\u5206\u522b\u4e0b\u8f7dEmmyLuaDebugger\u548cCMake3.30.2\uff0c\u7528CMake\u6253\u5f00EmmyLuaDebugger<\/p>\n\n\n\n<p>\u914d\u7f6e\u5982\u4e0b &#8211; \u52fe\u9009EMMY_USE_LUA_SOURCE, EMMY_LUA_VERSION\u8bbe\u7f6e\u4e3a53<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"771\" height=\"483\" src=\"http:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2024\/08\/image-4.png\" alt=\"\" class=\"wp-image-5834\" srcset=\"https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2024\/08\/image-4.png 771w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2024\/08\/image-4-512x321.png 512w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2024\/08\/image-4-768x481.png 768w, https:\/\/blog.coolcoding.cn\/wp-content\/uploads\/2024\/08\/image-4-144x90.png 144w\" sizes=\"(max-width: 771px) 100vw, 771px\" \/><\/figure>\n\n\n\n<p>\u518d\u7f16\u8bd1emmy_core\uff0c\u53d1\u73b0\u53ef\u4ee5\u6b63\u5e38\u8c03\u8bd5<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ lua_version.h\n#pragma once\n\n\/\/ lua version\nenum class LuaVersion {\n\tUNKNOWN,\n\tLUA_JIT = 50,\n\tLUA_51 = 51,\n\tLUA_52 = 52,\n\tLUA_53 = 53,\n\tLUA_54 = 54,\n};\n\nextern LuaVersion luaVersion;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ lua_version.cpp\n#if EMMY_LUA_51\nLuaVersion luaVersion = LuaVersion::LUA_51;\n#elif EMMY_LUA_52\nLuaVersion luaVersion = LuaVersion::LUA_52;\n#elif EMMY_LUA_53\nLuaVersion luaVersion = LuaVersion::LUA_53;\n#elif EMMY_LUA_54\nLuaVersion luaVersion = LuaVersion::LUA_54;\n#elif EMMY_LUA_JIT\nLuaVersion luaVersion = LuaVersion::LUA_JIT;\n#else\nLuaVersion luaVersion = LuaVersion::UNKNOWN;\n#endif<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8d77\u56e0\uff1a Emmylua\u53ef\u4ee5\u7528\u4e8eUnity\u5f00\u53d1\u4e0e\u8c03\u8bd5\uff0c\u5982\u679c\u4e0d\u7528Unity+XLua \u81ea\u5df1\u7528\u5b98\u65b9\u7684Lua 5.3. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/5831"}],"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=5831"}],"version-history":[{"count":4,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/5831\/revisions"}],"predecessor-version":[{"id":5837,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/5831\/revisions\/5837"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}