Commit 19536aba authored by Tt's avatar Tt

代码待优化

parent c870c606
{
"ver": "1.1.2",
"uuid": "19a64a93-34ed-4e65-9303-d0a268c1803c",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.0",
"uuid": "927f6c73-f3af-4c69-a990-9dc6668dbb70",
"subMetas": {}
}
\ No newline at end of file
// pg.event.emit('npc_layer_back_init',{ })
// pg.event.emit('npc_voice_play_voice_start') // pg.event.emit('npc_voice_play_voice_start')
// pg.event.emit('npc_voice_play_voice_end') // pg.event.emit('npc_voice_play_voice_end')
...@@ -14,25 +15,50 @@ export default class LayerBack extends cc.Component { ...@@ -14,25 +15,50 @@ export default class LayerBack extends cc.Component {
this.initView(); this.initView();
this.initEvent(); this.initEvent();
} }
private label_title: cc.Node;
initView() { initView() {
this.btn_back = pg.view.find(this, 'btn_back') this.btn_back = pg.view.find(this, 'btn_back')
this.img_npc_voice = pg.view.find(this, 'img_npc_voice') this.label_title = pg.view.find(this, 'label_title')
this.img_npc_voice = pg.view.find(this.label_title, 'img_npc_voice')
pg.view.touchOn(this.img_npc_voice, this.playVoiceStart, this);
}
private npcTitle: string;
private npcAudio: string;
updateView(data) {
this.npcTitle = data.npcTitle || '';
this.npcAudio = data.npcAudio || '';
pg.view.visible(this.img_npc_voice, this.npcAudio)
pg.view.visible(this.label_title, this.npcTitle)
pg.view.setString(this.label_title, this.npcTitle);
} }
initEvent() { initEvent() {
pg.view.touchOn(this.btn_back, this.onTouchBack, this) pg.view.touchOn(this.btn_back, this.onTouchBack, this)
pg.event.on('npc_layer_back_init', (data) => {
pg.event.on('npc_voice_play_voice_start', () => { this.updateView(data);
this.playVoiceStart(); if (!this.npcAudio) {
}) pg.event.emit('npc_voice_play_voice_end');
pg.event.on('npc_voice_play_voice_end', () => { } else {
this.playVoiceEnd(); this.playVoiceStart();
}
}) })
} }
private playVoiceCount: number; private playVoiceCount: number;
private audioId: number;
playVoiceStart() { playVoiceStart() {
if (this.playVoiceCount > 0) return; if (this.playVoiceCount > 0) {
if (this.audioId) cc.audioEngine.stopEffect(this.audioId);
this.playVoiceEnd();
}
this.playVoiceCount = 0; this.playVoiceCount = 0;
this.schedule(this.playVoiceRunning, 0.3) this.schedule(this.playVoiceRunning, 0.3)
pg.audio.playAudioByUrl(this.npcAudio, () => {
this.playVoiceEnd();
pg.event.emit('npc_voice_play_voice_end')
}, (audioId) => {
this.audioId = audioId;
});
} }
playVoiceRunning() { playVoiceRunning() {
this.playVoiceCount++; this.playVoiceCount++;
...@@ -54,7 +80,9 @@ export default class LayerBack extends cc.Component { ...@@ -54,7 +80,9 @@ export default class LayerBack extends cc.Component {
p3.active = false; p3.active = false;
} }
onTouchBack() { onTouchBack() {
alert('back') const middleLayer = cc.find('middleLayer');
const middleLayerComponent = middleLayer.getComponent('middleLayer');
middleLayerComponent.exitGame();
} }
} }
......
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 22
}, },
{ {
"__id__": 20 "__id__": 23
} }
], ],
"_prefab": { "_prefab": {
"__id__": 21 "__id__": 24
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 960,
0, 540,
0, 0,
0, 0,
0, 0,
...@@ -286,14 +286,14 @@ ...@@ -286,14 +286,14 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "61ulP3c3dDLb+4SfgnWK1F", "fileId": "61ulP3c3dDLb+4SfgnWK1F",
"sync": false "sync": false
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "img_npc_voice", "_name": "label_title",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1 "__id__": 1
...@@ -301,22 +301,90 @@ ...@@ -301,22 +301,90 @@
"_children": [ "_children": [
{ {
"__id__": 8 "__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 20
}
],
"_prefab": {
"__id__": 21
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 188,
"g": 132,
"b": 235,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 150.74,
"height": 63
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-685.473,
441.1,
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": ""
},
{
"__type__": "cc.Node",
"_name": "img_npc_voice",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 9
}, },
{ {
"__id__": 11 "__id__": 12
}, },
{ {
"__id__": 14 "__id__": 15
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 17 "__id__": 18
} }
], ],
"_prefab": { "_prefab": {
"__id__": 18 "__id__": 19
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -328,8 +396,8 @@ ...@@ -328,8 +396,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 100,
"height": 0 "height": 100
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -340,8 +408,8 @@ ...@@ -340,8 +408,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-638.532, 208.95399999999995,
437.61, 0,
0, 0,
0, 0,
0, 0,
...@@ -370,17 +438,17 @@ ...@@ -370,17 +438,17 @@
"_name": "p1", "_name": "p1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 8
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 10
} }
], ],
"_prefab": { "_prefab": {
"__id__": 10 "__id__": 11
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -434,7 +502,7 @@ ...@@ -434,7 +502,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 9
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -467,9 +535,9 @@ ...@@ -467,9 +535,9 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "eeSSmA+sZKe4zFitN7jaL3", "fileId": "24sc3KKz1GwYD9fN1vST/m",
"sync": false "sync": false
}, },
{ {
...@@ -477,17 +545,17 @@ ...@@ -477,17 +545,17 @@
"_name": "p2", "_name": "p2",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 8
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 12 "__id__": 13
} }
], ],
"_prefab": { "_prefab": {
"__id__": 13 "__id__": 14
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -541,7 +609,7 @@ ...@@ -541,7 +609,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 12
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -574,9 +642,9 @@ ...@@ -574,9 +642,9 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "29QTrf+y1JVa+D/t6K2NFr", "fileId": "3eNvEzM/JP56UZzdtTQAIN",
"sync": false "sync": false
}, },
{ {
...@@ -584,17 +652,17 @@ ...@@ -584,17 +652,17 @@
"_name": "p3", "_name": "p3",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 7 "__id__": 8
}, },
"_children": [], "_children": [],
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 15 "__id__": 16
} }
], ],
"_prefab": { "_prefab": {
"__id__": 16 "__id__": 17
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
...@@ -648,7 +716,7 @@ ...@@ -648,7 +716,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 14 "__id__": 15
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -681,9 +749,9 @@ ...@@ -681,9 +749,9 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "4anvaDTjZFOb9U0HkCAMR2", "fileId": "72yribDepLjZha4CRHI/xf",
"sync": false "sync": false
}, },
{ {
...@@ -691,15 +759,15 @@ ...@@ -691,15 +759,15 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 7 "__id__": 8
}, },
"_enabled": true, "_enabled": true,
"alignMode": 1, "alignMode": 2,
"_target": null, "_target": null,
"_alignFlags": 9, "_alignFlags": 32,
"_left": 321.46799999999996, "_left": 0,
"_right": 0, "_right": -108.21399999999997,
"_top": 102.38999999999999, "_top": 0,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -719,9 +787,55 @@ ...@@ -719,9 +787,55 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
},
"fileId": "e4KS5h7tdFiJnCxI3YJ5LQ",
"sync": false
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "I Spell",
"_N$string": "I Spell",
"_fontSize": 50,
"_lineHeight": 50,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "927f6c73-f3af-4c69-a990-9dc6668dbb70"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "fft5aHS35DjoYobvKkISue", "fileId": "0aBC7NPVlMNKQpHcVkCq5H",
"sync": false "sync": false
}, },
{ {
...@@ -767,7 +881,7 @@ ...@@ -767,7 +881,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
}, },
"fileId": "", "fileId": "",
"sync": false "sync": false
......
{
"ver": "1.1.2",
"uuid": "508c4cc0-7802-495f-8c13-85a2a81c52cd",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 117, "height": 117,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"back_hy08_caici": { "back_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "92327074-92fd-4d4a-a8aa-32f7ed514ab1", "uuid": "92327074-92fd-4d4a-a8aa-32f7ed514ab1",
"rawTextureUuid": "d3006e79-2315-4059-8aee-8e7a4d56121f", "rawTextureUuid": "d3006e79-2315-4059-8aee-8e7a4d56121f",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 70, "height": 70,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"pic_icon_tiger1_hy08_caici": { "pic_icon_tiger1_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "008bbd55-b1e7-4e82-bf54-f6cf40ebb738", "uuid": "008bbd55-b1e7-4e82-bf54-f6cf40ebb738",
"rawTextureUuid": "593366d0-c41f-40dd-8cfa-72e2fbdb78b8", "rawTextureUuid": "593366d0-c41f-40dd-8cfa-72e2fbdb78b8",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 70, "height": 70,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"pic_icon_tiger2_hy08_caici": { "pic_icon_tiger2_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "603d0882-deba-4173-8432-b9da5e547d20", "uuid": "603d0882-deba-4173-8432-b9da5e547d20",
"rawTextureUuid": "f6f170f4-59de-40e0-b666-1ddaf58a6997", "rawTextureUuid": "f6f170f4-59de-40e0-b666-1ddaf58a6997",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 70, "height": 70,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"pic_icon_tiger_hy08_caici": { "pic_icon_tiger_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "5d214bcc-ae6a-48b2-8e3e-693089d66911", "uuid": "5d214bcc-ae6a-48b2-8e3e-693089d66911",
"rawTextureUuid": "ffa50fcc-6561-4673-8e93-5e4abf03d963", "rawTextureUuid": "ffa50fcc-6561-4673-8e93-5e4abf03d963",
......
{
"ver": "1.1.2",
"uuid": "5302f1d3-299b-4ec3-82d6-b6229fca203f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "a36cd0ec-3891-435e-968b-934c346aa8dc",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "815cbe35-e740-4514-a84b-9fa42bd3957f",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "4c8b7a1c-163d-4358-811b-1c79de3c9b9b",
"subMetas": {}
}
\ No newline at end of file
{"name":"金币","SubTexture":[{"name":"金币动画/金币底","x":1,"height":181,"y":181,"width":172},{"name":"金币动画/条","x":175,"height":18,"y":181,"width":9},{"name":"金币动画/圈","x":1,"height":178,"y":1,"width":218},{"name":"金币动画/金币","x":221,"height":185,"y":1,"width":178}],"height":512,"imagePath":"coin1_tex_hy01_danci.png","width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "d0a6e7e0-94c8-4828-bd3e-ab5d98f0a611",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "570fd30f-4838-4f67-816d-5c827db29a50",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 512,
"platformSettings": {},
"subMetas": {
"coin1_tex_hy01_danci": {
"ver": "1.0.4",
"uuid": "6a3fb1c1-925f-471e-89e2-d797a62edd31",
"rawTextureUuid": "570fd30f-4838-4f67-816d-5c827db29a50",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -56,
"offsetY": 74.5,
"trimX": 1,
"trimY": 1,
"width": 398,
"height": 361,
"rawWidth": 512,
"rawHeight": 512,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "40224cac-9b7c-433a-a36a-ccead9ba6688",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "f011f737-1f65-490f-b1ca-1a960c98d8f9",
"subMetas": {}
}
\ No newline at end of file
{"name":"金币2","SubTexture":[{"name":"金币动画/金币底","x":1,"height":181,"y":181,"width":172},{"name":"金币动画/条","x":175,"height":18,"y":181,"width":9},{"name":"金币动画/圈","x":1,"height":178,"y":1,"width":218},{"name":"金币动画/金币","x":221,"height":185,"y":1,"width":178}],"height":512,"imagePath":"coin2_tex_hy01_danci.png","width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "bcb9481d-5c54-4e50-85ad-777961ce63b2",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "9d1174da-be3b-490b-bbcd-0c43439093da",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 512,
"platformSettings": {},
"subMetas": {
"coin2_tex_hy01_danci": {
"ver": "1.0.4",
"uuid": "4a536775-acd5-494c-83fa-3a0d5c924980",
"rawTextureUuid": "9d1174da-be3b-490b-bbcd-0c43439093da",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -56,
"offsetY": 74.5,
"trimX": 1,
"trimY": 1,
"width": 398,
"height": 361,
"rawWidth": 512,
"rawHeight": 512,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "3d98b47f-f41e-4bf1-a130-a5edf51b794d",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "7d43789c-0138-4603-82af-1892d2cad30a",
"downloadMode": 0,
"duration": 1.085333,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "a9b135f6-de46-4257-8be2-55dc863ce747",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
// pg.event.emit('layer_coin_show_coin',1) //1 2 3硬币数量
// pg.event.once('layer_coin_show_coin_end',()=>{}) // 动画回调
import pg from "../../scene/pg_hy08_caici";
const { ccclass, property } = cc._decorator;
@ccclass
export default class LayerCoin extends cc.Component {
private layout_center;
onLoad() {
pg.event.on('layer_coin_show_coin', (num) => { this.showCoin(num) });
this.layout_center = pg.view.find(this, 'layout_center')
}
showCoin(num) {
pg.view.visible(this.layout_center, true)
let coinAni = null;
pg.view.visible(pg.view.find(this.layout_center, "aniNode1"), false)
pg.view.visible(pg.view.find(this.layout_center, "aniNode2"), false)
pg.view.visible(pg.view.find(this.layout_center, "aniNode3"), false)
switch (num) {
case 1:
coinAni = pg.view.find(this.layout_center, "aniNode1");
coinAni.active = true;
pg.view.addEventDBAnimation(coinAni, this.hideCoin, this);
pg.view.playDBAnimation(coinAni, "one", 1);
this.playLocalAudio('coin');
break;
case 2:
coinAni = pg.view.find(this.layout_center, "aniNode2");
coinAni.active = true;
pg.view.addEventDBAnimation(coinAni, this.hideCoin, this);
pg.view.playDBAnimation(coinAni, "two", 1);
this.playLocalAudio('coin');
this.scheduleOnce(() => {
this.playLocalAudio('coin');
}, 0.3)
break;
case 3:
coinAni = pg.view.find(this.layout_center, "aniNode3");
coinAni.active = true;
pg.view.addEventDBAnimation(coinAni, this.hideCoin, this);
pg.view.playDBAnimation(coinAni, "three", 1);
this.playLocalAudio('coin');
this.scheduleOnce(() => {
this.playLocalAudio('coin');
}, 0.3)
this.scheduleOnce(() => {
this.playLocalAudio('coin');
}, 0.6)
break;
}
}
hideCoin() {
this.scheduleOnce(() => {
pg.view.visible(this.layout_center, false)
pg.event.emit('layer_coin_show_coin_end')
}, 1.0)
}
playLocalAudio(name) {
let ending = pg.view.find(this, `res/${name}`)
pg.audio.playLocalAudio(ending)
}
}
{
"ver": "1.0.8",
"uuid": "7280210e-c21d-4ab8-a9c1-1d8727b60658",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "47713aab-b8a5-494e-a027-eaec5a0f69ce",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.2.9",
"uuid": "8944c192-3675-466f-9f94-8f824c68e822",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
// pg.event.once('layer_ending_touch_replay', () => {
// alert('replay')
// })
// pg.event.emit('layer_ending_show')
import pg from "../../scene/pg_hy08_caici";
const { ccclass, property } = cc._decorator;
@ccclass
export default class LayerEnding extends cc.Component {
private layer_center: cc.Node;
private replay_btn: cc.Node;
private next_btn: cc.Node;
private res: cc.Node;
onLoad() {
this.layer_center = pg.view.find(this.node, "layer_center")
this.res = pg.view.find(this.node, "res")
pg.view.visible(this.layer_center, false);
this.replay_btn = pg.view.find(this.layer_center, "replay_btn")
this.next_btn = pg.view.find(this.layer_center, "next_btn")
pg.view.touchOn(this.replay_btn, this.onTouchReplay, this)
pg.view.touchOn(this.next_btn, this.onTouchNext, this)
pg.event.on('layer_ending_show', (data) => {
this.showLayer(data);
})
}
showLayer(data) {
let ending = pg.view.find(this.res, "ending")
pg.audio.playLocalAudio(ending)
pg.view.visible(this.layer_center, true)
pg.view.setString(pg.view.find(this.layer_center, 'finish_box/coin_num'), 'X' + data.coin);
let finish_cat = pg.view.find(this.layer_center, "finish_cat")
pg.view.playDBAnimation(finish_cat, "finish", 1);
let bg_light = pg.view.find(this.layer_center, "bg_light")
cc.tween(bg_light).by(2, { angle: 360 }).repeatForever().start();
pg.view.visible(this.layer_center, true)
}
onTouchReplay() {
pg.view.visible(this.layer_center, false)
pg.event.emit('layer_ending_touch_replay');
}
onTouchNext() {
pg.view.visible(this.layer_center, false)
const middleLayer = cc.find('middleLayer');
const middleLayerComponent = middleLayer.getComponent('middleLayer');
const { index, length } = middleLayerComponent.getPageInfo(); // 返回 length:有多少页; index: 当前第几页(从0开始)
if (index == length - 1) {
middleLayerComponent.goNextCross(); // 跳转到下一关卡
} else {
middleLayerComponent.goNextPage(); // 跳转到下一页
}
}
}
{
"ver": "1.0.8",
"uuid": "8aa90d3e-7980-43ef-be5d-3707ef42a804",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "abb5bf98-8e6e-4fda-bdcf-071a0f553e21",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "a5293080-0ee0-4320-804d-3a0173a7c120",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "80d273de-f7a1-45e8-b75c-b4c3032d0b78",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6cda522a-b8bc-40b4-b8c5-28ccdbd817b4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1024,
"height": 1024,
"platformSettings": {},
"subMetas": {
"finish": {
"ver": "1.0.4",
"uuid": "df8c0d1b-db97-497e-b721-ebebd22dac62",
"rawTextureUuid": "6cda522a-b8bc-40b4-b8c5-28ccdbd817b4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -10.5,
"offsetY": 75.5,
"trimX": 1,
"trimY": 1,
"width": 1001,
"height": 871,
"rawWidth": 1024,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{"name":"finish","version":"5.5","frameRate":24,"isGlobal":0,"armature":[{"name":"Armature","animation":[{"name":"finish","ffd":[],"frame":[],"duration":26,"slot":[{"name":"金币底","colorFrame":[{"tweenEasing":0,"color":{"aM":0},"duration":4},{"tweenEasing":0,"color":{"aM":0},"duration":6},{"tweenEasing":0,"color":{"aM":44},"duration":10},{"color":{"aM":0},"duration":6}],"displayFrame":[]},{"name":"圈","colorFrame":[{"tweenEasing":0,"color":{"aM":0},"duration":4},{"tweenEasing":0,"color":{"aM":0},"duration":4},{"tweenEasing":0,"color":{"aM":0},"duration":6},{"tweenEasing":0,"color":{"aM":40},"duration":6},{"color":{"aM":0},"duration":6}],"displayFrame":[]},{"name":"金币","colorFrame":[],"displayFrame":[{"duration":4,"value":-1},{"duration":7,"value":-1},{"duration":15}]},{"name":"条1","colorFrame":[{"color":{"aM":0},"duration":8},{"curve":[0,0,0.34269662921348315,0.9952978056426333],"color":{"aM":22},"duration":11},{"tweenEasing":0,"duration":7},{"color":{"aM":0},"duration":0}],"displayFrame":[]},{"name":"条11","colorFrame":[{"color":{"aM":0},"duration":8},{"curve":[0,0,0.5,1],"color":{"aM":22},"duration":11},{"tweenEasing":0,"duration":7},{"color":{"aM":0},"duration":0}],"displayFrame":[]},{"name":"条111","colorFrame":[{"color":{"aM":0},"duration":8},{"curve":[0,0,0.5,1],"color":{"aM":22},"duration":11},{"tweenEasing":0,"duration":7},{"color":{"aM":0},"duration":0}],"displayFrame":[]},{"name":"条12","colorFrame":[{"color":{"aM":0},"duration":8},{"curve":[0,0,0.5,1],"color":{"aM":22},"duration":11},{"tweenEasing":0,"duration":7},{"color":{"aM":0},"duration":0}],"displayFrame":[]},{"name":"条13","colorFrame":[{"color":{"aM":0},"duration":8},{"curve":[0,0,0.34269662921348315,0.9952978056426333],"color":{"aM":22},"duration":11},{"tweenEasing":0,"duration":7},{"color":{"aM":0},"duration":0}],"displayFrame":[]},{"name":"条121","colorFrame":[{"color":{"aM":0},"duration":8},{"curve":[0,0,0.34269662921348315,0.9952978056426333],"color":{"aM":22},"duration":11},{"tweenEasing":0,"duration":7},{"color":{"aM":0},"duration":0}],"displayFrame":[]},{"name":"条122","colorFrame":[{"color":{"aM":0},"duration":8},{"curve":[0,0,0.34269662921348315,0.9952978056426333],"color":{"aM":22},"duration":11},{"tweenEasing":0,"duration":7},{"color":{"aM":0},"duration":0}],"displayFrame":[]}],"bone":[{"name":"root","translateFrame":[],"rotateFrame":[],"scaleFrame":[]},{"name":"金币底","translateFrame":[],"rotateFrame":[],"scaleFrame":[{"x":1.3,"duration":4,"tweenEasing":0,"y":1.3},{"x":1.3,"duration":6,"tweenEasing":0,"y":1.3},{"duration":16}]},{"name":"圈","translateFrame":[],"rotateFrame":[],"scaleFrame":[{"duration":11},{"duration":9,"tweenEasing":0},{"x":1.4,"duration":6,"y":1.4}]},{"name":"金币","translateFrame":[],"rotateFrame":[],"scaleFrame":[{"duration":11},{"x":0.5,"duration":4,"tweenEasing":0,"y":0.5},{"duration":7,"curve":[0.7359550561797753,0.009404388714733543,1,1],"y":1.1},{"duration":4}]},{"name":"条1","translateFrame":[{"duration":8},{"x":93.3333,"duration":11,"tweenEasing":0,"y":33.3333},{"x":-236.6667,"duration":7,"y":-54.1608}],"rotateFrame":[{"duration":8},{"duration":11,"tweenEasing":0},{"rotate":-93.3665,"duration":7}],"scaleFrame":[{"duration":8},{"x":0.7,"duration":11,"tweenEasing":0,"y":0.7},{"duration":7}]},{"name":"bone","translateFrame":[],"rotateFrame":[{"duration":22,"clockwise":2,"tweenEasing":0},{"duration":4}],"scaleFrame":[]},{"name":"条11","translateFrame":[{"duration":8},{"x":-178.25,"duration":11,"curve":[0,0,0.5,1],"y":33.3333},{"x":-581.1667,"duration":7,"y":-526.7441}],"rotateFrame":[{"duration":8},{"curve":[0,0,0.5,1],"duration":11},{"rotate":-93.3665,"duration":7}],"scaleFrame":[{"duration":8},{"x":0.7,"duration":11,"curve":[0,0,0.5,1],"y":0.7},{"duration":7}]},{"name":"条111","translateFrame":[{"duration":8},{"x":-178.25,"duration":11,"curve":[0,0,0.5,1],"y":33.3333},{"x":146.8333,"duration":7,"y":-138.9941}],"rotateFrame":[{"duration":8},{"curve":[0,0,0.5,1],"duration":11},{"rotate":-93.3665,"duration":7}],"scaleFrame":[{"duration":8},{"x":0.7,"duration":11,"curve":[0,0,0.5,1],"y":0.7},{"duration":7}]},{"name":"条12","translateFrame":[{"duration":8},{"x":93.3333,"duration":11,"curve":[0,0,0.5,1],"y":33.3333},{"x":300.8333,"duration":7,"y":-54.1608}],"rotateFrame":[{"duration":8},{"curve":[0,0,0.5,1],"duration":11},{"rotate":-93.3665,"duration":7}],"scaleFrame":[{"duration":8},{"x":0.7,"duration":11,"curve":[0,0,0.5,1],"y":0.7},{"duration":7}]},{"name":"条13","translateFrame":[{"duration":8},{"x":93.3333,"duration":11,"tweenEasing":0,"y":33.3333},{"x":321,"duration":7,"y":-189.8274}],"rotateFrame":[{"duration":8},{"duration":11,"tweenEasing":0},{"rotate":-34.1966,"duration":7}],"scaleFrame":[{"duration":8},{"x":0.7,"duration":11,"tweenEasing":0,"y":0.7},{"duration":7}]},{"name":"条121","translateFrame":[{"duration":8},{"x":93.3333,"duration":11,"tweenEasing":0,"y":33.3333},{"x":-236.6667,"duration":7,"y":-54.1608}],"rotateFrame":[{"duration":8},{"duration":11,"tweenEasing":0},{"rotate":-93.3665,"duration":7}],"scaleFrame":[{"duration":8},{"x":0.7,"duration":11,"tweenEasing":0,"y":0.7},{"duration":7}]}],"ik":[],"playTimes":0}],"bone":[{"name":"root","transform":{"x":-131.6667,"y":16.6667}},{"name":"圈","transform":{"x":140.655,"y":-240.8618},"parent":"root"},{"name":"金币","transform":{"x":143.8193,"y":-246.4},"parent":"root"},{"name":"条1","transform":{"x":33.3193,"y":-90.0208},"parent":"root"},{"name":"金币底","transform":{"x":146.8193,"y":-242},"parent":"root"},{"name":"bone","transform":{"x":138.33,"y":-245.75},"parent":"root"},{"name":"条11","transform":{"x":323.3193,"scY":0.7,"y":-95.8541,"scX":0.7},"parent":"root"},{"name":"条111","transform":{"x":323.3193,"scY":0.7,"y":-95.8541,"scX":0.7},"parent":"root"},{"name":"条12","transform":{"x":166.6526,"y":-40.0208},"parent":"root"},{"name":"条13","transform":{"x":98.1526,"y":-115.9375},"parent":"root"},{"name":"条121","transform":{"x":33.3193,"y":-90.0208},"parent":"root"}],"skin":[{"name":"","slot":[{"name":"条11","display":[{"name":"金币动画/条","transform":{"x":-270.4571,"skX":-39.1322,"y":73.2524,"skY":-39.1322},"type":"image","path":"金币动画/条"}]},{"name":"圈","display":[{"name":"金币动画/圈","transform":{"x":3.5699,"y":0.3676},"type":"image","path":"金币动画/圈"}]},{"name":"金币底","display":[{"name":"金币动画/金币底","transform":{"x":-3,"y":-0.5},"type":"image","path":"金币动画/金币底"}]},{"name":"金币","display":[{"name":"金币动画/金币","transform":{"y":5.9},"type":"image","path":"金币动画/金币"}]},{"name":"条1","display":[{"name":"金币动画/条","transform":{"x":122.0667,"scY":0.5,"y":-6.3667,"scX":0.5},"type":"image","path":"金币动画/条"}]},{"name":"条111","display":[{"name":"金币动画/条","transform":{"x":-0.1,"y":-0.2},"type":"image","path":"金币动画/条"}]},{"name":"条13","display":[{"name":"金币动画/条","transform":{"x":122.0667,"scY":0.5,"y":-6.3667,"scX":0.5},"type":"image","path":"金币动画/条"}]},{"name":"条12","display":[{"name":"金币动画/条","transform":{"x":-0.1,"y":-0.2},"type":"image","path":"金币动画/条"}]},{"name":"条122","display":[{"name":"金币动画/条","transform":{"x":-0.1,"y":-0.2},"type":"image","path":"金币动画/条"}]},{"name":"条121","display":[]}]}],"defaultActions":[{"gotoAndPlay":"finish"}],"frameRate":24,"slot":[{"name":"金币底","color":{},"parent":"金币底"},{"name":"圈","color":{},"z":1,"parent":"圈"},{"name":"金币","color":{},"z":2,"parent":"金币"},{"name":"条1","color":{},"z":3,"parent":"条1"},{"name":"条11","color":{},"z":4,"parent":"条11"},{"name":"条111","color":{},"z":5,"parent":"条111"},{"name":"条12","color":{},"z":6,"parent":"条12"},{"name":"条13","color":{},"z":7,"parent":"条13"},{"name":"条121","color":{},"z":8,"parent":"root","displayIndex":-1},{"name":"条122","color":{},"z":9,"parent":"条121"}],"type":"Armature","ik":[],"aabb":{"x":-243.44169151262471,"height":497.77919520611704,"y":-469.33333333333337,"width":512}}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "a3fdb391-e9ad-464d-ad51-2698de2b38e1",
"subMetas": {}
}
\ No newline at end of file
{"name":"finish","SubTexture":[{"name":"金币动画/金币底","x":1,"height":487,"y":1,"width":487},{"name":"金币动画/圈","x":490,"height":420,"y":1,"width":512},{"name":"金币动画/金币","x":490,"height":449,"y":423,"width":388},{"name":"金币动画/条","x":880,"height":104,"y":423,"width":105}],"height":1024,"imagePath":"finish.png","width":1024}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "c9537625-dbfc-4d95-a3b3-d3d672dc93e6",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "664f0051-39fd-4f00-be8e-9b38b7b09e09",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 714,
"height": 166,
"platformSettings": {},
"subMetas": {
"bg_finish_hy17_hds_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "23a8b623-34a7-4290-b6c8-d6092f00b95d",
"rawTextureUuid": "664f0051-39fd-4f00-be8e-9b38b7b09e09",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 714,
"height": 166,
"rawWidth": 714,
"rawHeight": 166,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "68923e19-0a44-4014-996d-ed2c1f3adb8f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1104,
"height": 1109,
"platformSettings": {},
"subMetas": {
"bg_finishlight_hy17_hds_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "25fb3f92-bcc7-4131-9799-223ffe697b15",
"rawTextureUuid": "68923e19-0a44-4014-996d-ed2c1f3adb8f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1104,
"height": 1109,
"rawWidth": 1104,
"rawHeight": 1109,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "14a91e97-25df-434f-bebc-0fc904a33ded",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 153,
"height": 153,
"platformSettings": {},
"subMetas": {
"btn_next_hy17_hds_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "9cddc7ee-9ccf-4dd5-86a6-94b3a5d69135",
"rawTextureUuid": "14a91e97-25df-434f-bebc-0fc904a33ded",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 153,
"height": 153,
"rawWidth": 153,
"rawHeight": 153,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c50a3c0b-6c2c-4bca-a5f4-ab2a99cd1936",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 153,
"height": 153,
"platformSettings": {},
"subMetas": {
"btn_replay_hy17_hds_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "1b782eab-25d2-4314-b83a-258f7e4d7ea4",
"rawTextureUuid": "c50a3c0b-6c2c-4bca-a5f4-ab2a99cd1936",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 153,
"height": 153,
"rawWidth": 153,
"rawHeight": 153,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "4ca1236a-5bad-48ce-87f8-972316595c05",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 67,
"height": 70,
"platformSettings": {},
"subMetas": {
"icon_coin_hy17_hds_hy06_danxuan": {
"ver": "1.0.4",
"uuid": "4c1488d1-d283-4f03-864e-742eedadf6d9",
"rawTextureUuid": "4ca1236a-5bad-48ce-87f8-972316595c05",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 67,
"height": 70,
"rawWidth": 67,
"rawHeight": 70,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "d05ee77e-7d87-4d5a-b953-c0d649f3ed2e",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "78fa786c-cb39-47d2-a4a8-c6325aa156bb",
"downloadMode": 0,
"duration": 4.04898,
"subMetas": {}
}
\ No newline at end of file
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 960,
0, 540,
0, 0,
0, 0,
0, 0,
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "87B5iKbmVCG49S3eGPMX6Y", "fileId": "87B5iKbmVCG49S3eGPMX6Y",
"sync": false "sync": false
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "0dJz4b1ElNA4O7qSiigyoD", "fileId": "0dJz4b1ElNA4O7qSiigyoD",
"sync": false "sync": false
...@@ -482,7 +482,7 @@ ...@@ -482,7 +482,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "29MTzfz4ZJY5RAZYwGGyzy", "fileId": "29MTzfz4ZJY5RAZYwGGyzy",
"sync": false "sync": false
...@@ -589,7 +589,7 @@ ...@@ -589,7 +589,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "4bI88i+L9GR5mwmTy9p9U4", "fileId": "4bI88i+L9GR5mwmTy9p9U4",
"sync": false "sync": false
...@@ -704,7 +704,7 @@ ...@@ -704,7 +704,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "bfmkl7sk1AkKt8zX7VXGXI", "fileId": "bfmkl7sk1AkKt8zX7VXGXI",
"sync": false "sync": false
...@@ -847,7 +847,7 @@ ...@@ -847,7 +847,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "9dj4iTb+pEI58ageziAqnd", "fileId": "9dj4iTb+pEI58ageziAqnd",
"sync": false "sync": false
...@@ -873,7 +873,7 @@ ...@@ -873,7 +873,7 @@
"__id__": 31 "__id__": 31
} }
], ],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 34 "__id__": 34
...@@ -931,7 +931,7 @@ ...@@ -931,7 +931,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "p1", "_name": "p0",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 21 "__id__": 21
...@@ -1009,7 +1009,7 @@ ...@@ -1009,7 +1009,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "84c11178-f263-4e14-aa51-104545bb5499" "__uuid__": "c9eb055f-e3e0-4f6e-9e05-45d7c4608877"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -1031,14 +1031,14 @@ ...@@ -1031,14 +1031,14 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "fbQ2idx8VGzpMfXJAlUOXZ", "fileId": "bdZKY4yrNNrp3uiGJ2mSt/",
"sync": false "sync": false
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "p0", "_name": "p1",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 21 "__id__": 21
...@@ -1116,7 +1116,7 @@ ...@@ -1116,7 +1116,7 @@
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "c9eb055f-e3e0-4f6e-9e05-45d7c4608877" "__uuid__": "84c11178-f263-4e14-aa51-104545bb5499"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
...@@ -1138,9 +1138,9 @@ ...@@ -1138,9 +1138,9 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "bdZKY4yrNNrp3uiGJ2mSt/", "fileId": "fbQ2idx8VGzpMfXJAlUOXZ",
"sync": false "sync": false
}, },
{ {
...@@ -1245,7 +1245,7 @@ ...@@ -1245,7 +1245,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "50FwDbDDFGEpKc84rgx9jB", "fileId": "50FwDbDDFGEpKc84rgx9jB",
"sync": false "sync": false
...@@ -1352,7 +1352,7 @@ ...@@ -1352,7 +1352,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "c0INCALCJCWbSmpeyJ9a58", "fileId": "c0INCALCJCWbSmpeyJ9a58",
"sync": false "sync": false
...@@ -1390,7 +1390,7 @@ ...@@ -1390,7 +1390,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "c1eTuWbUBDEofGhSF4EZXo", "fileId": "c1eTuWbUBDEofGhSF4EZXo",
"sync": false "sync": false
...@@ -1428,7 +1428,7 @@ ...@@ -1428,7 +1428,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "2ertaiEAVHrqIyQ0eZHP8i", "fileId": "2ertaiEAVHrqIyQ0eZHP8i",
"sync": false "sync": false
...@@ -1476,7 +1476,7 @@ ...@@ -1476,7 +1476,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "35fbe4f1-249e-4263-90a1-de923c148363"
}, },
"fileId": "", "fileId": "",
"sync": false "sync": false
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"__id__": 34 "__id__": 34
} }
], ],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 43 "__id__": 43
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 960,
0, 540,
0, 0,
0, 0,
0, 0,
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
"__id__": 12 "__id__": 12
} }
], ],
"_active": true, "_active": false,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 15 "__id__": 15
...@@ -564,7 +564,7 @@ ...@@ -564,7 +564,7 @@
"__id__": 20 "__id__": 20
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 23 "__id__": 23
...@@ -647,8 +647,8 @@ ...@@ -647,8 +647,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 2000, "width": 5000,
"height": 2000 "height": 5000
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -895,7 +895,7 @@ ...@@ -895,7 +895,7 @@
"__id__": 29 "__id__": 29
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 32 "__id__": 32
...@@ -978,8 +978,8 @@ ...@@ -978,8 +978,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 2000, "width": 5000,
"height": 2000 "height": 5000
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -1226,7 +1226,7 @@ ...@@ -1226,7 +1226,7 @@
"__id__": 38 "__id__": 38
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 41 "__id__": 41
...@@ -1309,8 +1309,8 @@ ...@@ -1309,8 +1309,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 2000, "width": 5000,
"height": 2000 "height": 5000
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
......
// pg.event.emit('layer_record_open', {
// letter: 'test',
// targetTime: 10
// })
// pg.event.emit('layer_record_close')
//pg.event.on('layer_record_start_record',()=>{});
//pg.event.on('layer_record_end_record',()=>{});
import pg from "../../scene/pg_hy08_caici"; import pg from "../../scene/pg_hy08_caici";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
let win: any = window; let win: any = window;
...@@ -14,21 +23,29 @@ export default class LayerRecord extends cc.Component { ...@@ -14,21 +23,29 @@ export default class LayerRecord extends cc.Component {
let btn_play = pg.view.find(this.layout_record, 'btn_play'); let btn_play = pg.view.find(this.layout_record, 'btn_play');
btn_play.active = false; btn_play.active = false;
this.initEvent(); this.initEvent();
pg.event.emit('layer_record_setting', { this.showVoiceWhite();
letter: 'test',
targetTime: 10
})
} }
private letter: string; private letter: string;
private targetTime: number; private targetTime: number;
private recordAudio: string;
initEvent() { initEvent() {
pg.event.on('layer_record_setting', (data) => { pg.event.on('layer_record_open', (data) => {
this.layout_record.active = true;
this.letter = data.letter this.letter = data.letter
this.targetTime = data.targetTime this.targetTime = data.targetTime
}) })
pg.event.on('layer_record_close', (data) => {
this.layout_record.active = false;
if (this.recordAudioId) {
cc.audioEngine.stopEffect(this.recordAudioId)
}
this.playVoiceEnd();
})
let btn_record = pg.view.find(this.layout_record, 'btn_record'); let btn_record = pg.view.find(this.layout_record, 'btn_record');
let btn_play = pg.view.find(this.layout_record, 'btn_play');
btn_record.on(cc.Node.EventType.TOUCH_START, this.onTouchRecord, this); btn_record.on(cc.Node.EventType.TOUCH_START, this.onTouchRecord, this);
btn_record.on(cc.Node.EventType.TOUCH_END, this.onTouchRecordEnd, this); btn_record.on(cc.Node.EventType.TOUCH_END, this.onTouchRecordEnd, this);
btn_play.on(cc.Node.EventType.TOUCH_END, this.onTouchPlayRecord, this);
} }
showVoiceWhite() { showVoiceWhite() {
...@@ -58,6 +75,68 @@ export default class LayerRecord extends cc.Component { ...@@ -58,6 +75,68 @@ export default class LayerRecord extends cc.Component {
let record_time = pg.view.find(this.layout_record, 'record_time'); let record_time = pg.view.find(this.layout_record, 'record_time');
record_time.getComponent(cc.Sprite).fillRange = 0; record_time.getComponent(cc.Sprite).fillRange = 0;
} }
showPlay() {
let btn_play = pg.view.find(this.layout_record, 'btn_play')
btn_play.active = !!this.recordAudio
let p0 = pg.view.find(btn_play, 'p0')
let p1 = pg.view.find(btn_play, 'p1')
let p2 = pg.view.find(btn_play, 'p2')
let p3 = pg.view.find(btn_play, 'p3')
p0.active = true;
p1.active = false;
p2.active = false;
p3.active = false;
}
private recordAudioId;
onTouchPlayRecord() {
if (!this.recordAudio) return;
if (this.playVoiceCount && this.playVoiceCount > -1) {
if (this.recordAudioId) {
cc.audioEngine.stopEffect(this.recordAudioId)
}
this.playVoiceEnd();
} else {
this.playVoiceStart();
pg.audio.playAudioByUrl(this.recordAudio, () => {
this.recordAudioId = null;
this.playVoiceEnd();
}, (audioId) => {
this.recordAudioId = audioId;
});
}
}
private playVoiceCount: number;
playVoiceStart() {
if (this.playVoiceCount > 0) return;
this.playVoiceCount = 0;
this.schedule(this.playVoiceRunning, 0.3)
}
playVoiceRunning() {
this.playVoiceCount++;
let btn_play = pg.view.find(this.layout_record, 'btn_play');
let p0 = btn_play.getChildByName('p0')
let p1 = btn_play.getChildByName('p1')
let p2 = btn_play.getChildByName('p2')
let p3 = btn_play.getChildByName('p3')
p0.active = false;
p1.active = this.playVoiceCount % 3 == 0;
p2.active = this.playVoiceCount % 3 == 1;
p3.active = this.playVoiceCount % 3 == 2;
}
playVoiceEnd() {
let btn_play = pg.view.find(this.layout_record, 'btn_play');
this.unschedule(this.playVoiceRunning)
this.playVoiceCount = 0;
let p0 = btn_play.getChildByName('p0')
let p1 = btn_play.getChildByName('p1')
let p2 = btn_play.getChildByName('p2')
let p3 = btn_play.getChildByName('p3')
p0.active = true;
p1.active = false;
p2.active = false;
p3.active = false;
}
protected update(dt: number): void { protected update(dt: number): void {
...@@ -65,11 +144,14 @@ export default class LayerRecord extends cc.Component { ...@@ -65,11 +144,14 @@ export default class LayerRecord extends cc.Component {
} }
//按钮触发,使用的方法 //按钮触发,使用的方法
async onTouchRecord() { async onTouchRecord() {
this.recordAudio = '';
this.showPlay();
let AniNode = pg.view.find(this.layout_record, 'AniNode'); let AniNode = pg.view.find(this.layout_record, 'AniNode');
AniNode.active = true; AniNode.active = true;
this.showTimeStart(); this.showTimeStart();
cc.audioEngine.stopAllEffects(); cc.audioEngine.stopAllEffects();
pg.event.emit('layer_record_start_record');
courseware && courseware.startTest(this.letter); //开始录音 courseware && courseware.startTest(this.letter); //开始录音
} }
async onTouchRecordEnd() { async onTouchRecordEnd() {
...@@ -81,13 +163,14 @@ export default class LayerRecord extends cc.Component { ...@@ -81,13 +163,14 @@ export default class LayerRecord extends cc.Component {
"refText": "I haven't found anything out about him yet.", "refText": "I haven't found anything out about him yet.",
"recordId": "6144295213f0a2200000ed93", "recordId": "6144295213f0a2200000ed93",
"eof": 1, "eof": 1,
audioUrl: 'http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3',
"result": { "result": {
"pronunciation": 25, "pronunciation": 25,
"resource_version": "3.1.0", "resource_version": "3.1.0",
"fluency": 60, "fluency": 60,
"rhythm": 90, "rhythm": 90,
"kernel_version": "5.2.4", "kernel_version": "5.2.4",
"overall": 25,//75 "overall": 8,//75
"integrity": 100, "integrity": 100,
"duration": "6.779", "duration": "6.779",
"rear_tone": "fall", "rear_tone": "fall",
...@@ -96,14 +179,20 @@ export default class LayerRecord extends cc.Component { ...@@ -96,14 +179,20 @@ export default class LayerRecord extends cc.Component {
"tokenId": "6144295408558b08dd000001", "tokenId": "6144295408558b08dd000001",
"applicationId": "154838659000009e" "applicationId": "154838659000009e"
} }
if (!courseware) return this.recrodEnd(testData) pg.event.emit('layer_record_end_record');
courseware && courseware.stopTest((data) => { if (!courseware) {
data = JSON.parse(data); return this.recrodEnd(testData)
this.recrodEnd(data); }
courseware && courseware.stopTest((res) => {
res = JSON.parse(res);
this.recrodEnd(res);
}); //结束录音 }); //结束录音
} }
async recrodEnd(data) { async recrodEnd(data) {
this.recordAudio = data.audioUrl;
this.showPlay();
let score = data.result.overall; let score = data.result.overall;
this.layout_record.active = false;
pg.event.emit('layer_record_score', score); pg.event.emit('layer_record_score', score);
} }
} }
......
// pg.event.on('layer_right_show_excellent_end', () => { // pg.event.once('layer_right_show_excellent_end', () => {
// alert('test') // alert('test')
// }) // })
// pg.event.emit('layer_right_show_excellent') // pg.event.emit('layer_right_show_excellent')
// pg.event.on('layer_right_show_good_end', () => { // pg.event.once('layer_right_show_good_end', () => {
// alert('test') // alert('test')
// }) // })
// pg.event.emit('layer_right_show_good') // pg.event.emit('layer_right_show_good')
// pg.event.on('layer_right_show_tryagain_end', () => { // pg.event.once('layer_right_show_tryagain_end', () => {
// alert('test') // alert('test')
// }) // })
// pg.event.emit('layer_right_show_tryagain') // pg.event.emit('layer_right_show_tryagain')
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 16, "height": 16,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"i10_hy08_caici": { "i10_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "045d2d5b-3dd4-4d14-9c48-d2653a121ff3", "uuid": "045d2d5b-3dd4-4d14-9c48-d2653a121ff3",
"rawTextureUuid": "836deb81-aab1-46ff-ad8a-a58986968f66", "rawTextureUuid": "836deb81-aab1-46ff-ad8a-a58986968f66",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 25, "height": 25,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"i11_hy08_caici": { "i11_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "30588365-43b3-44d3-ba68-7ed363a12cd8", "uuid": "30588365-43b3-44d3-ba68-7ed363a12cd8",
"rawTextureUuid": "2c3a0728-5d75-4ff1-ad2b-27138f7c708e", "rawTextureUuid": "2c3a0728-5d75-4ff1-ad2b-27138f7c708e",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 49, "height": 49,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"i12_hy08_caici": { "i12_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "39024710-3326-4a35-945b-9838ed3a664d", "uuid": "39024710-3326-4a35-945b-9838ed3a664d",
"rawTextureUuid": "cb1b8647-8a92-472e-8425-7b61f8198987", "rawTextureUuid": "cb1b8647-8a92-472e-8425-7b61f8198987",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 26, "height": 26,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"i13_hy08_caici": { "i13_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "32da9db5-0f38-4fe9-a829-cc72a7c493cb", "uuid": "32da9db5-0f38-4fe9-a829-cc72a7c493cb",
"rawTextureUuid": "3a4c01ad-8bf9-4479-ab00-f37810e0ace7", "rawTextureUuid": "3a4c01ad-8bf9-4479-ab00-f37810e0ace7",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 24, "height": 24,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"i14_hy08_caici": { "i14_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "8080ed25-725a-496d-ba84-a05b9d9c81b5", "uuid": "8080ed25-725a-496d-ba84-a05b9d9c81b5",
"rawTextureUuid": "5f83a256-61a4-4a7b-a0a3-a7d68a01aa89", "rawTextureUuid": "5f83a256-61a4-4a7b-a0a3-a7d68a01aa89",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"height": 25, "height": 25,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"i1_hy08_caici": { "i1_hy06_danxuan": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "26b83f5f-b0d0-49cf-a4b7-41ab49eb3c63", "uuid": "26b83f5f-b0d0-49cf-a4b7-41ab49eb3c63",
"rawTextureUuid": "bfe2d72f-fe2a-46b9-babb-d484e2726840", "rawTextureUuid": "bfe2d72f-fe2a-46b9-babb-d484e2726840",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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