Hi,
First of all, thanks for the greate game engine
Currently, I’m working on a project which is targeting someone uses this webapp
via very low download speed network.
Silent loading assets before switching scenes is mandatory, so I tried using ‘preloadScene’ method.
However, it seems like this method only works on Previews and not works in a web-mobile version build.
I recognized it’s not working by browser’s network log.
Here are the network log screenshots.
(You can see it in original size by clicking it.)
Here is each section of image’s description.
Section 1- This is a network log for running Preview on chrome browser.
I captured this before clicking ‘ENTER’ button which triggers loadscene() method.
Log lines below the selected blue line are all the assets using in the next scene.
You can see preloadScene is called and downloading assets for next scene is done successfully.
Section 2- This one I captured after loadscene() is called.
No downloading logs because preloadscene already done the job.
Everything works great.
Section 3- This one is for running Web-mobile build on Chrome.
The one that I have problem with.
I also took this screenshot before clicking ‘ENTER’ button.
You can see preloadscene’s callback method is called,
but there are no resources for the next scene downloaded.
Section 4- After I click button and trigger loadscene() method,
PNG resources in the next scene are started to be downloaded.
I tested it both Chrome and Microsoft Edge with enabled ‘Disable cache’ option on windows 10.
I also tried both Cocos creator 3.7.0 and 3.7.1 but the result was same.
Here is my source code.
@ccclass(‘IntroSceneManager’)
export class IntroSceneManager extends Component {
onLoad(){
director.preloadScene("sceneWorld", ()=>{
console.log("PRELOAD DONE.");
});
}
OnEnterButton(){
director.loadScene("sceneWorld");
}
}