Meqn / UnityWebGL.js

An easy solution for embedding Unity WebGL builds in webApp or Vue.js project, with two-way communication between your webApp and Unity. 🏣 在webApp 或 Vue.js 项目中嵌入 Unity WebGL,并支持通过API在 webApp 和 Unity 之间进行双向通信。
https://www.npmjs.com/package/unity-webgl
MIT License
133 stars 22 forks source link

unload function cause my page crashed #37

Closed AbbetWang closed 2 weeks ago

AbbetWang commented 1 month ago

I have a situation where, after packaging my Unity project as WebGL and calling unload function, the tab in Google Chrome becomes unresponsive. The DevTools for that tab are also unavailable. When I check the Google Chrome Task Manager, I see that the CPU usage for that tab's process is around 100%. This issue seems to occur shortly after calling unityInstance.quit. How can I resolve this problem to prevent the webpage from freezing and consuming high CPU resources?

Meqn commented 1 month ago

I'm not experiencing this, can you provide an online example?

imleeou commented 4 weeks ago

I think the same thing happened to me. I wanted to destroy unity when I switched pages, so I called unload(), causing the browser TAB to freeze and become unresponsive.

imleeou commented 3 weeks ago

Check for a long time, found that it seems to be a problem with unity resources, I use oss resources in the author demo, there will be no tab page card dead problem, embarrassing. loaderUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.loader.js", dataUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.data", frameworkUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.framework.js", codeUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.wasm"