Commit e57929b2 authored by Tt's avatar Tt

处理闪电效果

parent c07760f2
// pg.event.emit('img_voice_play_voice_start')
// pg.event.emit('img_voice_play_voice_end')
import pg from "./pg_sn05_night";
const { ccclass, property } = cc._decorator;
@ccclass
export default class ImgVoice extends cc.Component {
onLoad() {
this.initView();
this.initEvent();
}
protected onDestroy(): void {
this.unscheduleAllCallbacks();
}
initView() {
}
initEvent() {
pg.event.on('img_voice_play_voice_start', () => {
this.playVoiceStart();
})
pg.event.on('img_voice_play_voice_end', () => {
this.playVoiceEnd();
})
}
private playVoiceCount: number;
playVoiceStart() {
if (this.playVoiceCount > 0) return;
this.playVoiceCount = 0;
this.playVoiceRunning();
this.schedule(this.playVoiceRunning, 0.3)
}
playVoiceRunning() {
if (!this.node) return;
this.playVoiceCount++;
let list = this.node.children;
list.forEach((li, i) => {
li.active = this.playVoiceCount % list.length == i;
})
}
playVoiceEnd() {
this.unschedule(this.playVoiceRunning)
this.playVoiceCount = 0;
let list = this.node.children;
list.forEach((li, i) => {
li.active = false
})
}
}
{
"ver": "1.0.8",
"uuid": "dd264aa4-50ca-4479-8592-1e407ae7bb04",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -666,7 +666,9 @@ let pg = {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, loop);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
});
})
}
},
......
......@@ -75,19 +75,19 @@
"__id__": 5
},
{
"__id__": 37
"__id__": 49
}
],
"_active": true,
"_components": [
{
"__id__": 57
"__id__": 69
},
{
"__id__": 58
"__id__": 70
},
{
"__id__": 59
"__id__": 71
}
],
"_prefab": null,
......@@ -254,16 +254,19 @@
"__id__": 11
},
{
"__id__": 26
"__id__": 29
},
{
"__id__": 27
"__id__": 30
},
{
"__id__": 39
}
],
"_active": true,
"_components": [
{
"__id__": 36
"__id__": 48
}
],
"_prefab": null,
......@@ -544,7 +547,7 @@
"__id__": 12
},
{
"__id__": 19
"__id__": 23
}
],
"_active": true,
......@@ -572,8 +575,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
596.346,
-2329.692,
0,
-1649.33,
0,
0,
0,
......@@ -613,6 +616,12 @@
},
{
"__id__": 17
},
{
"__id__": 19
},
{
"__id__": 21
}
],
"_active": true,
......@@ -628,8 +637,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 240,
"height": 240
"width": 480,
"height": 480
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -667,7 +676,7 @@
},
{
"__type__": "cc.Node",
"_name": "img_ufo",
"_name": "bg_img_0",
"_objFlags": 0,
"_parent": {
"__id__": 12
......@@ -690,8 +699,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 324,
"height": 346
"width": 517,
"height": 462
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -702,7 +711,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
12.189,
0,
0,
0,
......@@ -725,7 +734,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "45AJt4rShPHbHPCnR8zsJL"
"_id": "e1dU0FWtBOjaGKXE85P4sE"
},
{
"__type__": "cc.Sprite",
......@@ -743,7 +752,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "7e967f0e-5e09-4b2b-9d31-2bc10aaaddef"
"__uuid__": "522aca64-35a5-4cc3-8898-c0fb00aae3d0"
},
"_type": 0,
"_sizeMode": 1,
......@@ -757,11 +766,11 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "5ckuAFxJJLMKHNN18iOKdx"
"_id": "d1od7PbPxFGaKxdr4S35Da"
},
{
"__type__": "cc.Node",
"_name": "img",
"_name": "bg_img_1",
"_objFlags": 0,
"_parent": {
"__id__": 12
......@@ -784,8 +793,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 240,
"height": 200
"width": 516,
"height": 462
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -796,8 +805,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
12.189,
0,
14.545,
0,
0,
0,
......@@ -819,7 +828,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "66oMgtlA9LR55toWGd4Ae4"
"_id": "a6Eo3fJzdFnrwy6x0kkGlw"
},
{
"__type__": "cc.Sprite",
......@@ -837,10 +846,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
"__uuid__": "7a043091-0c89-4c3c-9211-36465de33194"
},
"_type": 0,
"_sizeMode": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -851,11 +860,11 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "26syoaPC9DiZaenc3mDFGI"
"_id": "74eV1f3Y9FqJyiktN+dVkU"
},
{
"__type__": "cc.Node",
"_name": "text",
"_name": "bg_img_2",
"_objFlags": 0,
"_parent": {
"__id__": 12
......@@ -878,8 +887,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 240,
"height": 200
"width": 516,
"height": 462
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -890,8 +899,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
12.189,
0,
14.364,
0,
0,
0,
......@@ -913,10 +922,10 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "54bNiQNLNOmarb6V8WL+O8"
"_id": "07l+4GC8FBj4FqF8BJFoYy"
},
{
"__type__": "cc.Label",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
......@@ -930,46 +939,37 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "testtestset",
"_N$string": "testtestset",
"_fontSize": 90,
"_lineHeight": 100,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "01340b00-1ab9-45bf-9ce6-55427f0d825c"
"_spriteFrame": {
"__uuid__": "5a324d6f-5160-4a94-b6a1-c9b80de7f029"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": "5dd0wHF9RFJZh6KdVsSS3o"
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "a1GDRDyW9Pb6ECud7wOAdy"
},
{
"__type__": "cc.Node",
"_name": "bubble_broken",
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 11
"__id__": 12
},
"_children": [
"_children": [],
"_active": false,
"_components": [
{
"__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -981,8 +981,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 240,
"height": 240
"width": 270,
"height": 270
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -994,7 +994,7 @@
"ctor": "Float64Array",
"array": [
0,
0,
20,
0,
0,
0,
......@@ -1016,35 +1016,67 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "52lEt/XotC65C8WlfiqEr6"
"_id": "66oMgtlA9LR55toWGd4Ae4"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 19
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "26syoaPC9DiZaenc3mDFGI"
},
{
"__type__": "cc.Node",
"_name": "img_ufo",
"_name": "text",
"_objFlags": 0,
"_parent": {
"__id__": 19
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 22
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"r": 80,
"g": 35,
"b": 115,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 403,
"height": 504
"width": 260,
"height": 250
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1055,8 +1087,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-4,
-82.134,
0,
14.364,
0,
0,
0,
......@@ -1078,14 +1110,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d8jy2hw4tH3amfdYRt2hVJ"
"_id": "54bNiQNLNOmarb6V8WL+O8"
},
{
"__type__": "cc.Sprite",
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 20
"__id__": 21
},
"_enabled": true,
"_materials": [
......@@ -1095,35 +1127,45 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "3ad07a76-e5b3-4ab4-8277-49448f7e9972"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
"_string": "girl",
"_N$string": "girl",
"_fontSize": 160,
"_lineHeight": 250,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "01340b00-1ab9-45bf-9ce6-55427f0d825c"
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "66dAA17tBJG4a/20NTkC+e"
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": "5dd0wHF9RFJZh6KdVsSS3o"
},
{
"__type__": "cc.Node",
"_name": "img",
"_name": "bubble_broken",
"_objFlags": 0,
"_parent": {
"__id__": 19
"__id__": 11
},
"_children": [],
"_children": [
{
"__id__": 24
},
{
"__id__": 26
}
],
"_active": true,
"_components": [
{
"__id__": 23
"__id__": 28
}
],
"_prefab": null,
......@@ -1137,8 +1179,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 240,
"height": 200
"width": 480,
"height": 480
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1150,7 +1192,7 @@
"ctor": "Float64Array",
"array": [
0,
14.545,
0,
0,
0,
0,
......@@ -1172,46 +1214,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "42BpTsMaRIBJkcZpV7+Aur"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "e0b+Elj2FLaZl/gcICDuOP"
"_id": "52lEt/XotC65C8WlfiqEr6"
},
{
"__type__": "cc.Node",
"_name": "text",
"_name": "err_img_ele_right",
"_objFlags": 0,
"_parent": {
"__id__": 19
"__id__": 23
},
"_children": [],
"_active": true,
......@@ -1231,8 +1241,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 240,
"height": 200
"width": 485,
"height": 604
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1243,8 +1253,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
14.364,
-11.175,
53.088,
0,
0,
0,
......@@ -1266,10 +1276,10 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "9cHmpMNCFH3oIQyCoAm2M7"
"_id": "58W7GzDDZLT7evFFOXPknd"
},
{
"__type__": "cc.Label",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
......@@ -1283,36 +1293,37 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "testtestset",
"_N$string": "testtestset",
"_fontSize": 90,
"_lineHeight": 100,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "01340b00-1ab9-45bf-9ce6-55427f0d825c"
"_spriteFrame": {
"__uuid__": "9b79743f-0ef2-4f83-9962-7d504f869e37"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": "9987Qk0sREk4liDXiTqzjr"
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "7aHJ5y+K9L46/VzKjdOYU5"
},
{
"__type__": "cc.Node",
"_name": "layer_paopao",
"_name": "err_img_ele_left",
"_objFlags": 0,
"_parent": {
"__id__": 5
"__id__": 23
},
"_children": [],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 27
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
......@@ -1324,8 +1335,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 485,
"height": 602
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1336,8 +1347,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
-11.175,
53.088,
0,
0,
0,
......@@ -1359,27 +1370,535 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "3a7B5x5OFIoJP3NgMLbjJp"
"_id": "4dFmUSE8tDZ4ZxZ38KNcRv"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 26
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "bb0831d8-706b-4088-8807-3e91ab50bc58"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "d3jjPja3tHcoPddRBup5yO"
},
{
"__type__": "dd264qkUMpEeYWSHkB657sE",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
},
"_enabled": true,
"_id": "e0HjagholEIoAalLMGTFnu"
},
{
"__type__": "cc.Node",
"_name": "layer_paopao",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "3a7B5x5OFIoJP3NgMLbjJp"
},
{
"__type__": "cc.Node",
"_name": "layer_countdown",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [
{
"__id__": 31
},
{
"__id__": 36
}
],
"_active": false,
"_components": [
{
"__id__": 38
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
},
"_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": "a1o8uTZZJJ9o75NMxBkX5F"
},
{
"__type__": "cc.Node",
"_name": "progress",
"_objFlags": 0,
"_parent": {
"__id__": 30
},
"_children": [
{
"__id__": 32
}
],
"_active": true,
"_components": [
{
"__id__": 34
},
{
"__id__": 35
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 15,
"height": 620
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
881.586,
14.288,
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": "95fwhwKOtKt4fsnRl5GwYO"
},
{
"__type__": "cc.Node",
"_name": "bar",
"_objFlags": 0,
"_parent": {
"__id__": 31
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 33
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 15,
"height": 620
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-310,
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": "8elF8YRDlKMLYfGv7bznkg"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 32
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "18694e51-8133-4f78-9897-1b63a4f2d5ce"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b5EX3R8EtL46IOJzMaa0u0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "23b67434-3764-4fa9-bad7-336241954046"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1eim3ZIalPNrV06S3CdW4X"
},
{
"__type__": "cc.ProgressBar",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
},
"_enabled": true,
"_N$totalLength": 620,
"_N$barSprite": {
"__id__": 33
},
"_N$mode": 1,
"_N$progress": 1,
"_N$reverse": false,
"_id": "a4JLvfvUlGNY0j0H8zFwb1"
},
{
"__type__": "cc.Node",
"_name": "icon_tine",
"_objFlags": 0,
"_parent": {
"__id__": 30
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 37
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 75,
"height": 88
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
883.174,
-324.063,
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": "64KO9+a5tMULLbB1n3lqL6"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a7af5f8a-b0c6-49eb-ab6f-2f6e63033613"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b5/NbvIDVNBZVxIc47mdNN"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_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": 1920,
"_originalHeight": 1080,
"_id": "a63PILqyZJGrztqZNSmg3+"
},
{
"__type__": "cc.Node",
"_name": "layer_countdown",
"_name": "btn_voice",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [
{
"__id__": 28
"__id__": 40
},
{
"__id__": 33
"__id__": 42
},
{
"__id__": 44
}
],
"_active": true,
"_components": [
{
"__id__": 35
"__id__": 46
},
{
"__id__": 47
}
],
"_prefab": null,
......@@ -1393,8 +1912,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
"width": 140,
"height": 140
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1405,8 +1924,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
860,
430,
0,
0,
0,
......@@ -1428,27 +1947,20 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a1o8uTZZJJ9o75NMxBkX5F"
"_id": "95LoR/KS1DooEt6rNqOy5s"
},
{
"__type__": "cc.Node",
"_name": "progress",
"_name": "icon_vioce1",
"_objFlags": 0,
"_parent": {
"__id__": 27
"__id__": 39
},
"_children": [
{
"__id__": 29
}
],
"_children": [],
"_active": true,
"_components": [
{
"__id__": 31
},
{
"__id__": 32
"__id__": 41
}
],
"_prefab": null,
......@@ -1462,8 +1974,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 15,
"height": 620
"width": 139,
"height": 139
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1474,8 +1986,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
881.586,
14.288,
0,
0,
0,
0,
0,
......@@ -1497,20 +2009,52 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "95fwhwKOtKt4fsnRl5GwYO"
"_id": "bbPjdnqJFDrprJoheRfwmk"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 40
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "43b29bb7-6f39-4b2f-ad57-012c9666d70e"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1elU3fpixGNbe9Hm8ZzlP2"
},
{
"__type__": "cc.Node",
"_name": "bar",
"_name": "icon_vioce2",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 39
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 43
}
],
"_prefab": null,
......@@ -1524,20 +2068,20 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 15,
"height": 620
"width": 139,
"height": 139
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-310,
0,
0,
0,
0,
......@@ -1559,46 +2103,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "8elF8YRDlKMLYfGv7bznkg"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "18694e51-8133-4f78-9897-1b63a4f2d5ce"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b5EX3R8EtL46IOJzMaa0u0"
"_id": "0aPpLkSsVLk7E09XE8aK2f"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 42
},
"_enabled": true,
"_materials": [
......@@ -1609,10 +2121,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "23b67434-3764-4fa9-bad7-336241954046"
"__uuid__": "8c470267-d7b2-4d10-a0cf-b83aeeebacd3"
},
"_type": 1,
"_sizeMode": 0,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -1623,37 +2135,20 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "1eim3ZIalPNrV06S3CdW4X"
},
{
"__type__": "cc.ProgressBar",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
},
"_enabled": true,
"_N$totalLength": 620,
"_N$barSprite": {
"__id__": 30
},
"_N$mode": 1,
"_N$progress": 1,
"_N$reverse": false,
"_id": "a4JLvfvUlGNY0j0H8zFwb1"
"_id": "3by+mJL7VG7rwbX5fBp/N8"
},
{
"__type__": "cc.Node",
"_name": "icon_tine",
"_name": "icon_vioce3",
"_objFlags": 0,
"_parent": {
"__id__": 27
"__id__": 39
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 34
"__id__": 45
}
],
"_prefab": null,
......@@ -1667,8 +2162,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 75,
"height": 88
"width": 139,
"height": 139
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1679,8 +2174,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
883.174,
-324.063,
0,
0,
0,
0,
0,
......@@ -1702,14 +2197,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "64KO9+a5tMULLbB1n3lqL6"
"_id": "501OBejCFGAazbX9641Glz"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 33
"__id__": 44
},
"_enabled": true,
"_materials": [
......@@ -1720,7 +2215,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a7af5f8a-b0c6-49eb-ab6f-2f6e63033613"
"__uuid__": "c3c12d3b-e370-413a-acca-565a10fa453a"
},
"_type": 0,
"_sizeMode": 1,
......@@ -1734,22 +2229,22 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b5/NbvIDVNBZVxIc47mdNN"
"_id": "2dG9LKzvdEVrr5pG8l8Tkb"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 27
"__id__": 39
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_alignFlags": 33,
"_left": 0,
"_right": 0,
"_top": 0,
"_right": 30,
"_top": 40,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
......@@ -1759,9 +2254,19 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1920,
"_originalHeight": 1080,
"_id": "a63PILqyZJGrztqZNSmg3+"
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "64XGFrnKlITKv30RzcSsGF"
},
{
"__type__": "dd264qkUMpEeYWSHkB657sE",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
},
"_enabled": true,
"_id": "521Hyul5BHpKpR8byKsIMv"
},
{
"__type__": "cc.Widget",
......@@ -1799,13 +2304,13 @@
},
"_children": [
{
"__id__": 38
"__id__": 50
},
{
"__id__": 41
"__id__": 53
},
{
"__id__": 44
"__id__": 56
}
],
"_active": false,
......@@ -1863,11 +2368,11 @@
"_name": "font",
"_objFlags": 0,
"_parent": {
"__id__": 37
"__id__": 49
},
"_children": [
{
"__id__": 39
"__id__": 51
}
],
"_active": true,
......@@ -1925,13 +2430,13 @@
"_name": "BRLNSDB",
"_objFlags": 0,
"_parent": {
"__id__": 38
"__id__": 50
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 40
"__id__": 52
}
],
"_prefab": null,
......@@ -1987,7 +2492,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
"__id__": 51
},
"_enabled": true,
"_materials": [],
......@@ -2018,11 +2523,11 @@
"_name": "img",
"_objFlags": 0,
"_parent": {
"__id__": 37
"__id__": 49
},
"_children": [
{
"__id__": 42
"__id__": 54
}
],
"_active": true,
......@@ -2080,13 +2585,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 41
"__id__": 53
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 43
"__id__": 55
}
],
"_prefab": null,
......@@ -2142,7 +2647,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 42
"__id__": 54
},
"_enabled": true,
"_materials": [],
......@@ -2170,26 +2675,26 @@
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 37
"__id__": 49
},
"_children": [
{
"__id__": 45
"__id__": 57
},
{
"__id__": 47
"__id__": 59
},
{
"__id__": 49
"__id__": 61
},
{
"__id__": 51
"__id__": 63
},
{
"__id__": 53
"__id__": 65
},
{
"__id__": 55
"__id__": 67
}
],
"_active": true,
......@@ -2247,13 +2752,13 @@
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 46
"__id__": 58
}
],
"_prefab": null,
......@@ -2309,7 +2814,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 57
},
"_enabled": true,
"_clip": {
......@@ -2328,13 +2833,13 @@
"_name": "error",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 48
"__id__": 60
}
],
"_prefab": null,
......@@ -2390,7 +2895,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 47
"__id__": 59
},
"_enabled": true,
"_clip": {
......@@ -2409,13 +2914,13 @@
"_name": "create",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 50
"__id__": 62
}
],
"_prefab": null,
......@@ -2471,7 +2976,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
"__id__": 61
},
"_enabled": true,
"_clip": {
......@@ -2490,13 +2995,13 @@
"_name": "right",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 52
"__id__": 64
}
],
"_prefab": null,
......@@ -2552,7 +3057,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
"__id__": 63
},
"_enabled": true,
"_clip": {
......@@ -2571,13 +3076,13 @@
"_name": "fly",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 54
"__id__": 66
}
],
"_prefab": null,
......@@ -2633,7 +3138,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 53
"__id__": 65
},
"_enabled": true,
"_clip": {
......@@ -2652,13 +3157,13 @@
"_name": "countdown",
"_objFlags": 0,
"_parent": {
"__id__": 44
"__id__": 56
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 56
"__id__": 68
}
],
"_prefab": null,
......@@ -2714,7 +3219,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
"__id__": 67
},
"_enabled": true,
"_clip": {
......
import { asyncDelay, onHomeworkFinish } from "../script/util_sn05_night";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_sn05_night";
import pg from "./pg_sn05_night";
import ImgVoice from "./ImgVoice";
const { ccclass, property } = cc._decorator;
......@@ -136,18 +137,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
let list = this.currentQuestion.options;
let posList = [
[
cc.v2(-13, -76)
, cc.v2(-240, 290)
, cc.v2(250, 250)
, cc.v2(300, -310)
, cc.v2(-340, -300)
, cc.v2(-655, 300)
, cc.v2(-670, -90)
, cc.v2(630, 330)
, cc.v2(600, -40)
cc.v2(-300, 0)
, cc.v2(300, 0)
], [
cc.v2(-600, 0)
, cc.v2(0, 0)
, cc.v2(600, 0)
],
]
let posArr = posList[0];
let posArr = posList[list.length - 2];
for (let i = 0; i < list.length; i++) {
let data = list[i]
let item = cc.instantiate(paoaoParent)
......@@ -173,24 +171,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
let broken = item.getChildByName("bubble_broken")
let img = bubble.getChildByName("img")
let text = bubble.getChildByName("text")
let img_broken = broken.getChildByName("img")
let text_broken = broken.getChildByName("text")
pg.view.visible(broken, false)
// 判断是显示图片还是文字
if (data.type === 'img') {
pg.view.visible(img, true)
pg.view.visible(text, false)
pg.view.setNetImg(img, data.image, { w: 180, h: 160 })
pg.view.visible(img_broken, true)
pg.view.visible(text_broken, false)
pg.view.setNetImg(img_broken, data.image, { w: 180, h: 160 })
pg.view.setNetImg(img, data.image, { w: 270, h: 270 })
} else {
pg.view.visible(img, false)
pg.view.visible(text, true)
pg.view.setString(text, data.text)
pg.view.visible(img_broken, false)
pg.view.visible(text_broken, true)
pg.view.setString(text_broken, data.text)
}
// 点击泡泡
item.data = data;
......@@ -206,12 +196,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 如果泡泡没有到指定位置不允许点击
let item = e.target;
let data = e.target.data;
if (data.right) {
cc.Tween.stopAllByTarget(item)
// 成功 泡泡破碎 里面的内容消失
let bubble = e.target.getChildByName("bubble")
let broken = e.target.getChildByName("bubble_broken")
if (data.right) {
cc.Tween.stopAllByTarget(item)
pg.view.visible(bubble, false)
pg.view.visible(broken, true)
cc.tween(item).delay(0.5).call(() => {
......@@ -236,14 +225,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}, 1);
} else {
pg.hw.playLocalAudio('error')
// 失败 泡泡左右微晃两次
cc.tween(pg.view.find(item, 'bubble'))
.to(0.1, { x: -15 })
.to(0.1, { x: 0 })
.to(0.1, { x: 15 })
.to(0.1, { x: 0 })
.start()
pg.view.visible(bubble, false)
pg.view.visible(broken, true)
// 处理闪电效果
broken.getComponent(ImgVoice).playVoiceStart();
pg.hw.playLocalAudio('error').then(() => {
broken.getComponent(ImgVoice).playVoiceEnd();
pg.view.visible(bubble, true)
pg.view.visible(broken, false)
})
}
}
......@@ -257,15 +247,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
update(dt) {
if (!this.currentQuestion) return;
if (!this.startCreate) return;
this.time -= dt;
if (this.time <= 0) {
console.log("游戏结束部分")
this.nextQuestion();
// return;
}
this.updateTime();
// if (!this.currentQuestion) return;
// if (!this.startCreate) return;
// this.time -= dt;
// if (this.time <= 0) {
// console.log("游戏结束部分")
// this.nextQuestion();
// // return;
// }
// this.updateTime();
}
//----------------------------动画相关---------------------------------------------
......
......@@ -10,7 +10,7 @@ export const defaultData =
"duration": 10,
"options": [
{
"type": "text",
"type": "img",
"image": "http://staging-teach.cdn.ireadabc.com/e921b21c9ac22a623497b79cf849a421.png",
"audio": "",
"text": "info",
......@@ -25,16 +25,16 @@ export const defaultData =
"text": "bad",
"duration": "",
"content": "",
"right": true
"right": false
},
{
"type": "txt",
"image": "",
"audio": "",
"text": "bad",
"text": "info",
"duration": "",
"content": "",
"right": true
"right": false
}
],
"audioName": "bad.mp3"
......
......@@ -4484,6 +4484,7 @@ declare namespace cc {
Cocos Creator 场景中的所有节点类。<br/>
支持的节点事件,请参阅 {{#crossLink "Node.EventType"}}{{/crossLink}}。 */
export class Node extends _BaseNode {
data:any;
/** !#en
Group index of node.<br/>
Which Group this node belongs to will resolve that this node's collision components can collide with which other collision componentns.<br/>
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