-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Unitypackage] Improve WebGL export #759
base: master
Are you sure you want to change the base?
Conversation
Ok, I think it is easier to lock the .html file since it really is never changing from version to version in a functional way. Also I still want to have transparency and dynamical sizing without scrollbars. So I do not have to override the html file after each export. Hmmm I modify build.cs myself. |
I agree that anyone seriously using this would probably need to customize their export. This simply tries to make the current behavior more consistent over different Unity versions. Working with fixed html templates is a good idea for a future change. But that might fail completely when Unity does make a breaking change. |
I agree and have suggestion. Why not provide index.html next to build.cs and have versions on your repo for user to download with instructions where to put. That way breaking change is easily fixed by supplying new index.html. Great work by the way really nice flutter widget! |
The reason is because Unity is generating that file (depending on which Unity version you got). |
I agree. We maybe need some way to customize that. I also do change the exported files, but I have a script for that. |
Description
For WebGL exports, the function
ModifyWebGLExport
adds some extra functionality to Unity's index.html usingstring.replace
.Even If this replacing fails, the build will succeed and the user gets bugs or unintended behaviour in the browser.
For example WebGL doesn't work properly when exported using Unity 2019.
This pull request:
pause
andresume
functions.This probably won't fix every single Unity version, but users will now get an error message that might help in finding the problem.
Tested this to work with Unity:
2022.2.5, 2021.3.14, 2020.3.42, 2019.4.40, 2019.4.23
Based on #754 I assume that 2022.1.0b5 doesn't work yet, but that is an (outdated) beta release.
This also fixes #755.
Type of Change