onLoad: function () {
this.updateTime();
this.getResolution();
this.preloadScene("worldScene");
},
getResolution: function () {
Global.RESOLUTION_RATIO = cc.view.getFrameSize().height / cc.view.getFrameSize().width;
if (Global.RESOLUTION_RATIO > 17 / 9) {
this.loadingBar.node.scaleX = 0.8, this.label.node.scale = 0.7;
}
},
updateTime: function () {
var e = this;
this.schedule(function () {
if (Global.PRELOAD_RES_COUNT != 0) {
if (Global.PRELOAD_RES_COUNT != 15) {
e.loadingBar.progress = Global.PRELOAD_RES_COUNT / 15;
} else {
cc.director.loadScene("selectSexScene");
Global.PRELOAD_RES_COUNT = 0;
e.loadingBar.progress = 1;
}
}
}, 0.4);
},
preloadScene: function (e, t) {
var r = cc.director._getSceneUuid(e);
if (r) {
cc.director.emit(cc.Director.EVENT_BEFORE_SCENE_LOADING, e), cc.loader.load({
uuid: r.uuid,
type: "uuid"
}, function (e, t, r) {}, function (e, t) {
Global.PRELOAD_RES_COUNT++;
})
} else {
cc.log("没有此场景");
}
},
loadPrefabDir: function (e) {
cc.loader.loadResDir(e, function () {
Global.PRELOAD_RES_COUNT++;
});
}