loadingFun(sceneName, callback) {
let info = cc.director._getSceneUuid(sceneName);
if (info) {
cc.director.emit(cc.Director.EVENT_BEFORE_SCENE_LOADING, sceneName);
cc.loader.load({
uuid: info.uuid,
type: 'uuid'
},
(completedCount, totalCount, item) => {
console.log(completedCount + '/' + totalCount);//进度
},
() => {
if (this._completedCount >= this._totalCount && this._completedCount > 0) {
callback();//回调
}
}
)
}
},
可以参考下