
我是这么用的:
start () {
director.preloadScene(“scene/game”, this.onProgress.bind(this), function(){
console.log(“加载完成!”);
director.loadScene(“scene/game”);
})
}
onProgress(completedCount:any, totalCount:any, item:any){
this.pro=find("Canvas/preload");
this.pro.getChildByName("str").getComponent(Label).string = Math.floor(completedCount/totalCount * 100) + "%";
}
这个在微信小游戏中不能用吧,直接就到100%