[Unitypackage] Improve WebGL export #759
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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