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
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- 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)
Recent Comments
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- ffmpeg stream raw video into Unity Texture2D on