How to build WebGL
Back to ezysmashersRequired
- WebGL module has already been installed on your unity editor
1. Set up WebGL templates
- Go to
Edit -> Project Settings -> Player -> Web settings tab -> Resolution -> WebGL Templateand selectezyplatform
2. Update preferences to minimise build size
- Go to
Edit -> Project Settings -> Player -> Web settings tab- Enable
Strip Engine CodeinOther Settingssection - Select
Gzipfor Compression Format inPublishing Settingssection
- Enable
3. Build asset bundles
- Go to Addressbles Groups window -> Tool -> New Build -> Default Build Script. Asset bundles will be built to
ServerData/WebGLfolder. - Go to EzyPlatform Admin Dashboard -> EzySmashers -> Asset Bundles and upload files in
ServerData/WebGLto directoryWebGL
4. Build and run
- Go to
File -> Build Settings - Change Platform to
Web - Disable
Development buildfield - Select
DiskSizefor Code Optimisation field - Click on
Build and Runbutton - Select
Buildfolder toezysmashers-theme/src/main/resources/static/unity. After build finished, you can see:
- If you started
ezysmashers-theme(by runningEzySmashersThemeStartupTest) from IDE, you just need to reloadhttp://localhost:8080/on your browser - If you did not run
ezysmashers-themefrom IDE, you can navigate to ezyplatform home and restart web bybash cli.sh "restart web"(or.\cli.bat "restart web"in Windows)