How do I clean up and unload a Unity WebGL canvas when changing page

后端 未结 2 394
说谎
说谎 2020-12-18 09:33

I\'ve got a problem on my web application when I am changing the current page after downloading and running a Unity WebGL game.

In fact, I know for sure

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 10:10

    Unity 2019.1 provided proper way to Quit the webgl and release the memory(although it has failed in my testing, maybe i am wrong, please let me know it really works or not) :

    • C#: call Application.Quit()
    • JS: call unityInstance.Quit(callback)

    You can use JS version like this

    unityInstance.Quit(function() {
        console.log("done!");
    });
    

    For more please check Quit and memory cleanup

提交回复
热议问题