场景结构如下:
Canvas ---indexCanvas.js
Main Camera
game(node) -- gameComponent.js
file: main.js
cc.director.loadScene(launchScene,function(){
console.log("loadScene over");
});
file: indexCanvas.js
onload(){
console.log("indexCanvas over");
}
file: gameComponent.js
onload(){
console.log("gameComponent over");
}
结果:
indexCanvas over
gameComponent over
loadScene over
网友评论