{"id":94,"date":"2022-05-17T16:40:12","date_gmt":"2022-05-17T08:40:12","guid":{"rendered":"http:\/\/www.unityfans.com\/?p=94"},"modified":"2022-05-17T16:40:12","modified_gmt":"2022-05-17T08:40:12","slug":"unity3d%e4%b8%adxlua%e6%8f%92%e4%bb%b6%e5%ae%89%e8%a3%85%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.unityfans.com\/?p=94","title":{"rendered":"Unity3d\u4e2dXlua\u63d2\u4ef6\u5b89\u88c5\u6d41\u7a0b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Unity<\/strong><\/h2>\n\n\n\n<p>\u5f53\u524dunity\u7248\u672c \uff1a2020.3.33f1c2 personal<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Xlua<\/h2>\n\n\n\n<p>\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/github.com\/Tencent\/xLua\/releases<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"563\" src=\"http:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-4-1024x563.png\" alt=\"\" class=\"wp-image-98\" srcset=\"https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-4-1024x563.png 1024w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-4-300x165.png 300w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-4-768x422.png 768w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-4.png 1146w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u968f\u4fbf\u90a3\u90fd\u884c<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5\u6d41\u7a0b<\/h2>\n\n\n\n<p>1 \u89e3\u538b\u7f29\u538b\u7f29\u5305<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"551\" src=\"http:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-5.png\" alt=\"\" class=\"wp-image-99\" srcset=\"https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-5.png 855w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-5-300x193.png 300w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-5-768x495.png 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><\/figure>\n\n\n\n<p>2 \u62f7\u8d1dxlua\u4e2dAsset\u7684\u6240\u6709\u6587\u4ef6\u5230\u9879\u76eeAssets\u76ee\u5f55\u4e0b<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"619\" height=\"264\" src=\"http:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-6.png\" alt=\"\" class=\"wp-image-100\" srcset=\"https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-6.png 619w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-6-300x128.png 300w\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" \/><\/figure>\n\n\n\n<p>3 \u7b49\u5f85\u7f16\u8bd1\u8fc7\u540e\uff0c\u5728\u4e3b\u83dc\u5355\u51fa\u73b0\u5bf9\u5e94\u7684\u83dc\u5355<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"935\" height=\"210\" src=\"http:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-7.png\" alt=\"\" class=\"wp-image-101\" srcset=\"https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-7.png 935w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-7-300x67.png 300w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-7-768x172.png 768w\" sizes=\"auto, (max-width: 935px) 100vw, 935px\" \/><\/figure>\n\n\n\n<p>4 \u9a8c\u8bc1\u73af\u5883\uff0c\u628aExample\u4e2d\u7684hello world \u52a0\u5165\u5230\u573a\u666f\u5b9e\u4f8b\u4e2d\u8fd0\u884c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\n * Tencent is pleased to support the open source community by making xLua available.\n * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.\n * Licensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n * http:\/\/opensource.org\/licenses\/MIT\n * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n*\/\n\nusing UnityEngine;\nusing XLua;\n\nnamespace XLuaTest\n{\n    public class Helloworld : MonoBehaviour\n    {\n        \/\/ Use this for initialization\n        void Start()\n        {\n            LuaEnv luaenv = new LuaEnv();\n            luaenv.DoString(\"CS.UnityEngine.Debug.Log('hello world, xlua')\");\n            luaenv.Dispose();\n        }\n\n        \/\/ Update is called once per frame\n        void Update()\n        {\n\n        }\n    }\n}\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"177\" src=\"http:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-8.png\" alt=\"\" class=\"wp-image-102\" srcset=\"https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-8.png 825w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-8-300x64.png 300w, https:\/\/www.unityfans.com\/wp-content\/uploads\/2022\/05\/\u56fe\u7247-8-768x165.png 768w\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Unity \u5f53\u524dunity\u7248\u672c \uff1a2020.3.33f1c2 personal Xlua \u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/github.com\/Tencent\/xLua\/releases \u968f\u4fbf\u90a3\u90fd\u884c \u5b89\u88c5\u6d41\u7a0b 1 \u89e3\u538b\u7f29\u538b\u7f29\u5305 2 \u62f7\u8d1dxlua\u4e2dAsset\u7684\u6240\u6709\u6587\u4ef6\u5230\u9879\u76eeAssets\u76ee\u5f55\u4e0b 3 \u7b49\u5f85\u7f16\u8bd1\u8fc7\u540e\uff0c\u5728\u4e3b\u83dc\u5355\u51fa\u73b0\u5bf9\u5e94\u7684\u83dc\u5355 4 \u9a8c\u8bc1\u73af\u5883\uff0c\u628aExample\u4e2d\u7684hello world \u52a0\u5165\u5230\u573a\u666f\u5b9e\u4f8b\u4e2d\u8fd0\u884c<\/p>\n","protected":false},"author":1,"featured_media":99,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[19,15],"class_list":["post-94","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","tag-lua","tag-unity"],"_links":{"self":[{"href":"https:\/\/www.unityfans.com\/index.php?rest_route=\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unityfans.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unityfans.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unityfans.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unityfans.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=94"}],"version-history":[{"count":5,"href":"https:\/\/www.unityfans.com\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/www.unityfans.com\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions\/104"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.unityfans.com\/index.php?rest_route=\/wp\/v2\/media\/99"}],"wp:attachment":[{"href":"https:\/\/www.unityfans.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unityfans.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unityfans.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}