15
2023
Run webgl application locally using python
Unity has new runtime tax/fee, but it doesn’t apply for webgl games!
So how about you bundle your webgl build with simple batch script that starts webserver using python.
STEPS
– Build your webgl normally
– Copy this runwebgl.bat file into your webgl build folder (next to index.html) https://gist.github.com/unitycoder/0a1014d784c6b7884b3ab96e1e13806f
– Then run runwebgl.bat and it starts webserver (*only if Python is available to run from path, and opens your index.html)
TODO
– Test if compression works? brotli/gzip
—————————
https://forum.unity.com/threads/unity-plan-pricing-and-packaging-updates.1482750/
ALTERNATIVES
– Create simple webserver using c# and include that with your webgl build
– Or include any standalone webserver.exe with your webgl build
– Node.js can spin webserver also
Related Posts
Leave a comment
Recent posts
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
- Check if point is inside polygon 2D (using line intersection)
- UnityHub: Enable Create Project Button (without having to select Cloud Organization)
- UI: Make Tooltip background fit Text content length
- Pong-Wars in Unity
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub)