11
2021
Run WebGL server manually
When making webgl builds, you cannot open generated index.html file directly inside the build folder (without webserver), and if you make Build & Run, and then close the browser tab, you need to do build & run again to view it later.
Run webserver from commandline:"C:/Program Files/Unity2019_4/Editor/Data/MonoBleedingEdge/bin/mono.exe" "C:/Program Files/Unity2019_4/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/SimpleWebServer.exe" "X:/YourFolder/YourProject/Builds" 60606
* Note the port number as a parameter, other arguments are:
“SimpleWebServer.exe source_directory [port] [pid] [<wasmencoding>]”
** You need to run SimpleWebServer.exe through mono.exe, otherwise it returns “403 forbidden”.
Using UnityLauncherPro:
Just added experimental feature to launch webgl server from project context menu (it launches SimpleWebServer.exe)
Alternatives (web servers) *but requires you to build webgl inside those server folders)
– XAMPP, XAMPP Portable, WAMPP, IIS
Alternatives part#2:
– Use ILSpy to decompile SimpleWebServer.exe (its c#), then build it yourself in VisualStudio, now that .exe works normally without needing to run it through mono.exe (and you could customize it to do more things).
Related Posts
1 Comment + Add Comment
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)
[…] Source link title_words_as_hashtags […]