Commit db4631fc authored by huoshizhe's avatar huoshizhe

feat: 切換場景時顯示loading

parent 1b04e39b
...@@ -302,18 +302,21 @@ ...@@ -302,18 +302,21 @@
}, },
{ {
"__id__": 266 "__id__": 266
},
{
"__id__": 313
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 313 "__id__": 317
}, },
{ {
"__id__": 314 "__id__": 318
}, },
{ {
"__id__": 315 "__id__": 319
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -15395,6 +15398,201 @@ ...@@ -15395,6 +15398,201 @@
"fileId": "", "fileId": "",
"sync": false "sync": false
}, },
{
"__type__": "cc.Node",
"_name": "waitingLayer",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 314
},
{
"__id__": 315
},
{
"__id__": 316
}
],
"_prefab": null,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "64VjSE0+RFlbqIaZogyCP5"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 313
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "66fVSmpVhNBYmPr0vrtGuT"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 313
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_id": "73zENzOQ9CC6asHHo3/BVk"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 313
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "f7AHHfoZBIA73rTkrZrSfm"
},
{ {
"__type__": "cc.Widget", "__type__": "cc.Widget",
"_name": "", "_name": "",
......
...@@ -97,11 +97,11 @@ cc.Class({ ...@@ -97,11 +97,11 @@ cc.Class({
// }) // })
// }, 20000); // }, 20000);
// this.baseUrl = 'http://staging-teach.ireadabc.com/api/'; this.baseUrl = 'http://staging-teach.ireadabc.com/api/';
// this.initStoryBoxView({ this.initStoryBoxView({
// coursewareId: 18307 coursewareId: 18307
// }); });
// this.bundleType = 'StoryBox'; this.bundleType = 'StoryBox';
this.log('汪汪汪'); this.log('汪汪汪');
}, },
...@@ -544,8 +544,11 @@ cc.Class({ ...@@ -544,8 +544,11 @@ cc.Class({
}, },
showWaitingLetters() { showWaitingLetters() {
const waitingLayer = cc.find('middleLayer/waitingLayer');
waitingLayer.active = true;
const colorList = this.getRainbowColorList(); const colorList = this.getRainbowColorList();
const layout = cc.find('middleLayer/layout'); const layout = cc.find('middleLayer/layout');
layout.removeAllChildren();
layout.active = true; layout.active = true;
const str = 'Now Loading...'; const str = 'Now Loading...';
str.split('').forEach((word, idx) => { str.split('').forEach((word, idx) => {
...@@ -572,6 +575,8 @@ cc.Class({ ...@@ -572,6 +575,8 @@ cc.Class({
hideWaitingLetters() { hideWaitingLetters() {
const layout = cc.find('middleLayer/layout'); const layout = cc.find('middleLayer/layout');
layout.active = false; layout.active = false;
const waitingLayer = cc.find('middleLayer/waitingLayer');
waitingLayer.active = false;
}, },
showLog(str) { showLog(str) {
...@@ -610,6 +615,7 @@ cc.Class({ ...@@ -610,6 +615,7 @@ cc.Class({
}, },
loadBundle(conf, callback) { loadBundle(conf, callback) {
this.showWaitingLetters();
cc.assetManager.loadBundle(conf.bondleUrl, { version: conf.version }, async (err, bundle) => { cc.assetManager.loadBundle(conf.bondleUrl, { version: conf.version }, async (err, bundle) => {
if (err) { if (err) {
return this.asyncDelayLog(err); return this.asyncDelayLog(err);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment