Scene does not unload

Hi,

I am using a webview in a scene. When I use cc.director.loadScene(‘game2’), the previous scene should ideally unload. That is what is happening on the desktop, no problems at all.

But on android, I can still hear the audio from the webview content playing even after the ‘game2’ scene has loaded.

Cocos Creator is a great tool to work with. I am still new and learning, but it’s way more intuitive than I thought.

Solved. The previous scene unloads only if autoReleaseAssets = true is called explicitly.

cc.director._scene.autoReleaseAssets = true;
cc.director.loadScene(‘game2’);

3 Likes

@adikhel Thanks for info. You can also set autoReleaseAssets from Cocos Creator. Select scene asset and set checkbox in the properties tab:
daf9bdb45e9c6bce276b816fee7867cc

1 Like

Hi ,
I am using
cc.director._scene.autoReleaseAssets = true;
cc.director.loadScene(‘gamescene’),
Same scene I’m loading on game restart
but what ever the properties defined in the class that are not reinitialising all are showing null in web and mobile.

I am still new and learning cocos creator

What is the problem i’m not getting it can u help me out please