cc.director.preloadScene(“start”, this.onProgress.bind(this),function () {//预加载
cc.director.loadScene(“start”);}
onProgress: function (completedCount, totalCount, item) {
this.node.getChildByName("loader").getChildByName("process").getComponent(cc.Sprite).fillRange = completedCount/totalCount;
console.log(completedCount,totalCount);
},
先贴代码,预加载预加载进度条需求,场景很复杂加载蛮久,但是totalCount只有1,原设想会有很多,出来的结果如图:
