{"id":2403,"date":"2021-05-24T17:55:30","date_gmt":"2021-05-24T09:55:30","guid":{"rendered":"http:\/\/1vr.cn\/?p=2403"},"modified":"2021-05-24T17:55:30","modified_gmt":"2021-05-24T09:55:30","slug":"%e4%bb%8eunity4-x%e5%88%b0unity2021-x%e5%8f%8aunityscript%e5%88%b0c%e7%9a%84%e8%bd%ac%e6%8d%a2","status":"publish","type":"post","link":"https:\/\/1vr.cn\/?p=2403","title":{"rendered":"\u4eceUnity4.x\u5230Unity2021.x\u53caUnityScript\u5230C#\u7684\u8f6c\u6362"},"content":{"rendered":"\n<p>\u6253\u5f00\u5c18\u5c01\u7684\u9879\u76ee\u4ee3\u7801,\u6ee1\u6ee1\u7684\u56de\u5fc6.\u628a\u5b83\u4eec\u5347\u7ea7\u5230\u6700\u65b0\u7684Unity2021.x\u5427.\u56e0\u4e3a\u73b0\u5728Unity\u4e0d\u652f\u6301UnityScript\u5373js\u4e86.\u6240\u4ee5\u8981\u5347\u7ea7\u65e7\u7248\u672cUnity\u9879\u76ee,\u5c24\u5176\u4f7f\u7528JS\u5f00\u53d1\u7684\u9879\u76ee,\u8981\u8f6c\u6362\u7a0b\u5e8f\u8bed\u8a00,\u8fd8\u662f\u8981\u8d39\u70b9\u5468\u6298.<\/p>\n\n\n\n<p>\u9996\u5148\u7801\u9f50\u4e00\u4e9b\u5217\u7248\u672c,\u6bcf\u4e2a\u5927\u7248\u672c\u53f7\u5747\u5b89\u88c5\u4e00\u4efd,\u56e0\u4e3a\u65e7\u7248\u672c\u5728macOS\u4e0a\u65e0\u6cd5\u6b63\u5e38\u8fd0\u884c,\u6240\u4ee5\u53ea\u80fd\u4f7f\u7528\u5728Windows\u7684\u7248\u672c,\u5b89\u88c5\u597dUnity4.x\/Unity5.x\/Unity2017.x\/Unity2018.x\/Unity2020.x\/Unity2021.x\u7b49.\u6bcf\u4e2a\u5927\u7248\u672c\u5b89\u88c5\u6700\u65b0\u7684\u5c0f\u7248\u672c\u5c31\u53ef\u4ee5.\u4f46\u662fUnity2018.x\u8981\u5b89\u88c52018.1.x(\u542b)\u4e4b\u524d\u7684\u7248\u672c,\u56e0\u4e3a\u4e4b\u540e\u5c31\u4e0d\u518d\u652f\u6301UnityScript\u4e86.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u5c31\u5c31\u5c06\u9879\u76ee\u4eceUnity4.x\u5f00\u59cb\u5347\u7ea7\u6253\u5f00,\u6bcf\u4e2a\u7248\u672c\u6253\u5f00\u540e\u5982\u679c\u6709\u811a\u672c\u9519\u8bef\u5c31\u5c31\u8fdb\u884c\u9002\u5f53\u7684\u4fee\u6b63,\u76f4\u5230\u5347\u7ea7\u5230Unity2018.*\u5148\u505c\u4e0b\u6765.\u786e\u4fdd\u9879\u76ee\u53ef\u4ee5\u6b63\u5e38Play,\u65e0\u811a\u672c\u9519\u8bef.\u6bcf\u4e2a\u7248\u672c\u5347\u7ea7\u5b8c\u6210\u540e\u90fd\u5efa\u8bae\u8fdb\u884c\u5907\u4efd,\u4ee5\u9632\u67d0\u7248\u672c\u5931\u8d25\u65f6\u4e0d\u81f3\u4e8e\u4ece\u5934\u518d\u6765.<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\u8981\u505a\u7684\u662f\u5c06UnityScript\u8f6c\u6362\u4e3aC#,\u5f92\u624b\u7f16\u5199\u662f\u53ef\u4ee5\u7684,\u5f53\u7136\u8fd9\u6709\u70b9\u53ef\u6015.Unity\u5b98\u65b9\u63d0\u4f9b\u4e86\u8f6c\u6362\u5de5\u5177,\u5230Unity\u7684github\u4e0a\u4e0b\u8f7d(<a href=\"https:\/\/github.com\/Unity-Technologies\/unityscript2csharp\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/Unity-Technologies\/unityscript2csharp<\/a>),\u662f\u4e2aUnity Package,\u5c06\u5b83\u5bfc\u5165\u5230\u5f53\u524d\u9879\u76ee\u4e2d,\u4e3a\u4e86\u80fd\u8ba9\u8f6c\u6362\u7ed3\u679c\u8fbe\u5230\u6700\u597d,\u5efa\u8bae\u5728UnityScript\u4e2d&#8221;#pragma strict &#8220;\u8ba9\u539f\u6709\u7684\u4ee3\u7801\u66f4\u4e25\u8c28.\u6b63\u5e38\u60c5\u51b5\u4e0b\u5728Unity\u7684\u83dc\u5355\u4e2d\u53ef\u4ee5\u627e\u5230&#8221;Tools\/Convert Project from UnityScript to C#&#8221;,\u70b9\u51fb\u6267\u884c,\u7b49\u5f85\u8f6c\u6362\u5b8c\u6bd5,js\u6587\u4ef6\u90fd\u5c06\u81ea\u52a8\u589e\u52a0*.old\u540e\u7f00,\u9879\u76ee\u4e2d\u7684js\u90fd\u5c06\u4ea7\u751f\u540c\u540dc#\u6587\u4ef6,\u5e76\u4e14\u6240\u6709\u5f15\u7528\u90fd\u4f1a\u5bf9\u5e94\u66f4\u65b0.\u67e5\u770b\u662f\u5426\u6709\u65b0\u7684\u4ee3\u7801\u9519\u8bef,\u5982\u6709\u8fdb\u884c\u76f8\u5e94\u7684\u4fee\u6b63.\u5982\u9879\u76ee\u8f6c\u6362\u6b63\u5e38,\u53ef\u4ee5\u53bb\u8d44\u6e90\u7ba1\u7406\u5668\u4e2d\u641c\u7d22&#8221;*.js.old&#8221;\u5168\u90e8\u5220\u9664\u5373\u53ef.<\/p>\n\n\n\n<p>\u8fc7\u4e86\u8fd9\u4e00\u6b65\u5c31\u7b80\u5355\u4e86,\u7ee7\u7eed\u7528Unity2019.x\u7b49\u65b0\u7248\u672c\u9010\u7248\u6253\u5f00\u5347\u7ea7\u9879\u76ee.\u76f4\u5230\u5347\u7ea7\u5230\u6700\u65b0\u7248.\u6bcf\u4e2a\u5347\u7ea7\u6709\u9519\u8bef\u90fd\u8981\u53ca\u65f6\u4fee\u6b63,\u6bd4\u5982\u63d2\u4ef6\u4e0d\u517c\u5bb9\u7b49.<\/p>\n\n\n\n<p>\u597d\u4e86,\u5c31\u5199\u5230\u8fd9\u91cc,\u56de\u89c1.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u53c2\u8003\u94fe\u63a5:<a href=\"https:\/\/blog.unity.com\/technology\/unityscript-to-c-conversion-tool\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/blog.unity.com\/technology\/unityscript-to-c-conversion-tool<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6253\u5f00\u5c18\u5c01\u7684\u9879\u76ee\u4ee3\u7801,\u6ee1\u6ee1\u7684\u56de\u5fc6.\u628a\u5b83\u4eec\u5347\u7ea7\u5230\u6700\u65b0\u7684Unity2021.x\u5427.\u56e0\u4e3a\u73b0\u5728Unity\u4e0d\u652f\u6301Unity &hellip; <a href=\"https:\/\/1vr.cn\/?p=2403\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u4eceUnity4.x\u5230Unity2021.x\u53caUnityScript\u5230C#\u7684\u8f6c\u6362<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[215,214,208,213,216],"class_list":{"0":"post-2403","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-5","7":"tag-jsc","8":"tag-unityjs","9":"tag-unityscript","10":"tag-unity","12":"without-featured-image"},"_links":{"self":[{"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/posts\/2403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1vr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2403"}],"version-history":[{"count":1,"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/posts\/2403\/revisions"}],"predecessor-version":[{"id":2404,"href":"https:\/\/1vr.cn\/index.php?rest_route=\/wp\/v2\/posts\/2403\/revisions\/2404"}],"wp:attachment":[{"href":"https:\/\/1vr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1vr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1vr.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}