Hey guys.
I want to generate WebGl builds to a single html file. And run this with no server required.
Like this https://supercibo.github.io/minigame7/
No server required. You can download this html and test it.
I have 2 questions:
1.How to embed all resources and scripts into a single html file?
2.Why is this file so small, only 4.6MB?I have try to build an empty project and it is 20+MB.
Hi. Unity Editor/Engine itself doesn’t support producing single-file builds; this particular build is done with Unity Playworks: Make Playable Ads & Interactive End Cards | Unity, unfortunately I don’t have much knowledge about that product. For optimising your build, see, for example:
Hello,
The available file formats do not support running the exported HTML file without a live server. This limitation arises because the export options in the free version of the platform are designed to comply with the specifications of the selected network (UnityAds & ironSource).
In most cases, assets are streamed rather than embedded directly into a single HTML file. Additionally, network-imposed restrictions limit the file size to 5MB, necessitating small and optimized assets.
While your project may be larger during development, Playworks will only export and serialise the assets and files within the selected scene. The entire project will not be included unless explicitly added to the scene or incorporated via the interface options.
Playworks uses an advanced compression algorithm to minimise the overall project size. However, we recommend creating a scene specifically designed for Playable export, ensuring that only essential assets and scripts are included. Additionally, applying optimisation settings before export will help achieve the best performance in the browser.
Hope this helps.
Thanks.