For H5 projects published directly, http-server or anywhere -p
When you open it at this time, you will find that the page is as follows:
Solution: PlayerSetting->Player->Publishing Setting
Check DecomPression Fallback
It can work normally after being released at this time, but it is not full screen:
In the released H5 project, edit index.html file
Directly modify the style of canvas:
<canvas id="unity-canvas" style="width: 100%; height: 100%; background: #231F20"></canvas>
Or insert code in <Script> :
var canvas = document.getElementById("#unity-canvas");
canvas.height = document.documentElement.clientHeight;
canvas.width = document.documentElement.clientWidth;
This can solve the problem, but it is troublesome to modify it manually after each release. Later, we will study the automatic processing during release.
Or there are other full-screen settings.
Read More:
- Unity Package Webgl Error: Failed running “D:\Program Files\Unity2018.3.0f2\Unity\Editor\Data\PlaybackEngines\Web
- [Solved] Unity Package Error: Failed running D:\Program Files\Unity2018.4.1\Editor\Data\il2cpp/build/il2cpp.exe
- [Solved] Unity Import Xcode Project Error: iOS framework addition failed due to a CocoaPods installation failure.
- [Solved] Unity package Error: CommandInvokationFailure: Gradle build failed.
- [Solved] Unity Package Error: FAILURE: Build failed with an exception.
- [Solved] Wepy build watch Error: ERR! Parse WePY config failed. Are you trying to use
- Error: Unable to build IHost No DbContext named ‘PersistedGrantDbContext‘ was found.
- [Solved] VScode Error: build constraints exclude all Go files in syscall\js
- [Solved] ionic Build Error: Cannot load gulp tasks: Error: Error in module: .\gulpfile.js:
- Jenkins uses NPM to build Vue error, and the manual build is normal
- Git Push remote error: GH007: Your push would publish a private email address.
- [Solved] Vue.js error: Module build failed: Error: No parser and no file path given, couldn’t infer a parser.
- Webpack Pack and compress ES6 files with errors: ERROR in js/xxxxxx.js from UglifyJs Unexpected token punc ()
- Xcode12.5 package framework error [How to Solve]
- Node js events.js:183 throw er; // Unhandled ‘error’ event
- How to parse JSON string in.Net [error reading job object from jsonreader. Current jsonreader item is not an obj]
- [Solved] Unity Error: Assertion failed on expression: ‘IsMatrixValid(matrix)‘…
- Chart.js Error: “Canvas is already in use. Chart …must be destroyed before the canvas can be reused”
- How to Solve Docker ERROR: Service’workspace’ failed to build: ERROR: Service’php-fpm’ failed to build
- org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [XXX.xml]‘;