Not work, destroy prev scene after loadScene

hi there.
I try to SplashScene->MainScene. But functions in SplashScene keep calling after MainScene start()

code in SplashScene
onLoad()
{
… … …
cc.director.preloadScene(“1_MainScene”, function () {
LogManager.getIns().setLog(“onLoad”, “preloadScene”);
});
}
start()
{
let that = this;
this.scheduleOnce(that.setScene, 3);
}
setScene()
{//https://docs.cocos.com/creator/api/en/classes/Component.html#schedule
cc.log("[setScene] CALLed");
cc.director.loadScene(“1_MainScene”);
}

In case, Is it scene stack or schedule release issue?

Schedule release issue. Try add this:

onDestroy() {
    this.unscheduleAllCallbacks();
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.