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 Template
and selectezyplatform
2. Update preferences to minimise build size
- Go to
Edit -> Project Settings -> Player -> Web settings tab
- Enable
Strip Engine Code
inOther Settings
section - Select
Gzip
for Compression Format inPublishing Settings
section
- Enable
3. Build asset bundles
- Go to Addressbles Groups window -> Tool -> New Build -> Default Build Script. Asset bundles will be built to
ServerData/WebGL
folder. - Go to EzyPlatform Admin Dashboard -> EzySmashers -> Asset Bundles and upload files in
ServerData/WebGL
to directoryWebGL
4. Build and run
- Go to
File -> Build Settings
- Change Platform to
Web
- Disable
Development build
field - Select
DiskSize
for Code Optimisation field - Click on
Build and Run
button - Select
Build
folder 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-theme
from IDE, you can navigate to ezyplatform home and restart web bybash cli.sh "restart web"
(or.\cli.bat "restart web"
in Windows)