{"id":5807,"date":"2024-03-13T16:11:43","date_gmt":"2024-03-13T14:11:43","guid":{"rendered":"https:\/\/unitycoder.com\/blog\/?p=5807"},"modified":"2024-03-14T11:25:32","modified_gmt":"2024-03-14T09:25:32","slug":"using-moonsharp-lua-unity-webgl","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2024\/03\/13\/using-moonsharp-lua-unity-webgl\/","title":{"rendered":"Using Moonsharp (LUA) + Unity Webgl"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"986\" height=\"713\" data-attachment-id=\"5812\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2024\/03\/13\/using-moonsharp-lua-unity-webgl\/image-8-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?fit=986%2C713&amp;ssl=1\" data-orig-size=\"986,713\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-8\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?fit=300%2C217&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?fit=986%2C713&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?resize=986%2C713&#038;ssl=1\" alt=\"\" class=\"wp-image-5812\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?w=986&amp;ssl=1 986w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?resize=300%2C217&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?resize=768%2C555&amp;ssl=1 768w\" sizes=\"auto, (max-width: 986px) 100vw, 986px\" \/><\/a><\/figure>\n\n\n\n<p>Moonsharp has some issues in webgl builds, but here&#8217;s working repo and some notes.<\/p>\n\n\n\n<p><strong>REPO<\/strong> ( unity 2022.3.7f1 )<br>&#8211; <a href=\"https:\/\/github.com\/unitycoder\/MoonSharpWebGL\">https:\/\/github.com\/unitycoder\/MoonSharpWebGL<\/a><\/p>\n\n\n\n<p><strong>WEBGL DEMO<\/strong><br>&#8211; <a href=\"https:\/\/unitycoder.com\/upload\/demos\/moonsharpwebgl\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/unitycoder.com\/upload\/demos\/moonsharpwebgl\/<\/a><\/p>\n\n\n\n<p><strong>NOTES<\/strong><br>&#8211; You need to grab this webgl fix: <a href=\"https:\/\/github.com\/moonsharp-devs\/moonsharp\/pull\/146\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/moonsharp-devs\/moonsharp\/pull\/146<\/a><br>&#8211; You need to do hard wiring (or at least i didn&#8217;t get the link.xml file to work properly, it stripped my methods from LuaAPI class?) <a href=\"https:\/\/www.moonsharp.org\/hardwire.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.moonsharp.org\/hardwire.html<\/a> ) <br>&#8211; And then call that generated class.initialize, to keep it from getting stripped (i have that code inside Interpreter.cs Start() now as a test)<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Moonsharp has some issues in webgl builds, but here&#8217;s working repo and some notes. REPO ( unity 2022.3.7f1 )&#8211; https:\/\/github.com\/unitycoder\/MoonSharpWebGL WEBGL DEMO&#8211; https:\/\/unitycoder.com\/upload\/demos\/moonsharpwebgl\/ NOTES&#8211; You need to grab this webgl fix: https:\/\/github.com\/moonsharp-devs\/moonsharp\/pull\/146&#8211; You need to do hard wiring (or at least i didn&#8217;t get the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5812,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,3],"tags":[1284,1285,403,697,320],"class_list":["post-5807","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demos","category-unity3d","tag-lua","tag-moonsharp","tag-runtime","tag-scripting","tag-webgl"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/image-8.png?fit=986%2C713&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1vF","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=5807"}],"version-history":[{"count":6,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5807\/revisions"}],"predecessor-version":[{"id":5814,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5807\/revisions\/5814"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/5812"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=5807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=5807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=5807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}