I am using unity webGL build and this is the way to initalize/load unity webgl in javascript.
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/WebGLDemo.json", {onProgress: UnityProgress});
but there is no way to unload the webgl. I can remove the canvas tag but the problem is that some resources are remains in the memory which are not garbage collected. additionally when i try to remove
function DeleteGame(){
console.log("remove game");
document.getElementById("gameContainer").remove();
//gameInstance = null;
}
then we are getting furstum error
Screen position out of view frustum (screen pos 0.000000, 0.000000, 0.000000) (Camera rect 0 0 0 0)
Is there any proper way available to unload the webgl?
Is there any proper way available.. is there a special reason why you don't want to use an iframe?