Commit 97285f9a authored by yu's avatar yu

1

parent e2e480f0
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 150,
"height": 0 "height": 150
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "d649146b-22ea-4f4f-ae01-ceb7f495bfdc"
}, },
"fileId": "b2AVtPfI1H8rsYBg+57NsK", "fileId": "b2AVtPfI1H8rsYBg+57NsK",
"sync": false "sync": false
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "d649146b-22ea-4f4f-ae01-ceb7f495bfdc"
}, },
"fileId": "28xDtc6+BJ74MCN73DdTk4", "fileId": "28xDtc6+BJ74MCN73DdTk4",
"sync": false "sync": false
...@@ -402,7 +402,7 @@ ...@@ -402,7 +402,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "d649146b-22ea-4f4f-ae01-ceb7f495bfdc"
}, },
"fileId": "3bzotBPcdH6KRt6Og7x6F9", "fileId": "3bzotBPcdH6KRt6Og7x6F9",
"sync": false "sync": false
...@@ -435,7 +435,7 @@ ...@@ -435,7 +435,7 @@
"_id": "" "_id": ""
}, },
{ {
"__type__": "f6509JnLAlKfZ9VLFWlQcNk", "__type__": "8fa11v2FMRF5aYUQ2xw3/ss",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
...@@ -450,7 +450,7 @@ ...@@ -450,7 +450,7 @@
"__id__": 1 "__id__": 1
}, },
"asset": { "asset": {
"__id__": 0 "__uuid__": "d649146b-22ea-4f4f-ae01-ceb7f495bfdc"
}, },
"fileId": "", "fileId": "",
"sync": false "sync": false
......
...@@ -115,8 +115,9 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -115,8 +115,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.event.on("layer_record_score", (score) => { pg.event.on("layer_record_score", (score) => {
}); });
pg.event.on('npc_voice_play_voice_end', () => { pg.event.on('npc_voice_play_voice_end', async () => {
asyncDelay(0.3);
this.playQuestAudio();
}) })
pg.event.emit('npc_layer_back_init', this.data) pg.event.emit('npc_layer_back_init', this.data)
...@@ -149,6 +150,9 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -149,6 +150,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
let pic_light = cc.find("pic_light", node.parent); let pic_light = cc.find("pic_light", node.parent);
if (pic_light) pic_light.active = false; if (pic_light) pic_light.active = false;
}); });
cc.find("img_voice", this.node).on(cc.Node.EventType.TOUCH_END, () => {
this.playQuestAudio();
})
} }
sendData(score) { sendData(score) {
...@@ -175,11 +179,25 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -175,11 +179,25 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.initData(); this.initData();
this.initView(); this.initView();
} }
private playQuestAudio() {
cc.audioEngine.stopAllEffects();
let question = Game.getIns().getCurrentPage();
if (question.audioUrl != "") {
pg.event.emit("img_voice_play_voice_start");
pg.audio.playAudioByUrl(question.audioUrl).then(async () => {
this.isClick = true;
pg.event.emit("img_voice_play_voice_end");
})
} else {
this.isClick = true;
}
}
private playOpAudio() { private playOpAudio() {
let question = Game.getIns().getCurrentPage(); let question = Game.getIns().getCurrentPage();
if (question.audioUrl != "") { if (question.audioUrl != "") {
pg.event.emit("img_voice_play_voice_start");
pg.audio.playAudioByUrl(question.audioUrl).then(async () => { pg.audio.playAudioByUrl(question.audioUrl).then(async () => {
pg.event.emit("img_voice_play_voice_end");
await asyncDelay(0.5); await asyncDelay(0.5);
pg.event.emit("layer_right_show_excellent"); pg.event.emit("layer_right_show_excellent");
}) })
...@@ -294,7 +312,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -294,7 +312,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
await asyncDelay(0.03); await asyncDelay(0.03);
box_up.active = isBig; box_up.active = isBig;
this.isClick = true;
if (isBig && this.layout_up.width < this.layout_down.width) { if (isBig && this.layout_up.width < this.layout_down.width) {
this.layout_up.getComponent(cc.Layout).enabled = false; this.layout_up.getComponent(cc.Layout).enabled = false;
this.layout_up.width = this.layout_down.width; this.layout_up.width = this.layout_down.width;
......
...@@ -24,8 +24,8 @@ export const defaultData = { ...@@ -24,8 +24,8 @@ export const defaultData = {
"check": 1 "check": 1
} }
], ],
"audio": "", // "audio": "",
// "audio": "http://staging-teach.cdn.ireadabc.com/83268f4def70e408cf9243bc214592b6_l.mp3", "audio": "http://staging-teach.cdn.ireadabc.com/83268f4def70e408cf9243bc214592b6_l.mp3",
"contentMain": "what is\n your name?", "contentMain": "what is\n your name?",
"text": "", "text": "",
"audioName": "bear_1.mp3" "audioName": "bear_1.mp3"
......
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