Commit 6bfa8451 authored by 章红平's avatar 章红平

提交

parent 89fadf95
No preview for this file type
......@@ -3952,7 +3952,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 800,
"height": 101.69999999999999
"height": 300
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -4003,8 +4003,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫",
"_N$string": "调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫",
"_string": "调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫",
"_N$string": "调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫调皮的小猫",
"_fontSize": 30,
"_lineHeight": 45,
"_enableWrapText": true,
......@@ -4019,7 +4019,7 @@
"_N$horizontalAlign": 0,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 3,
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": "02PI4U2/hJgZqv1PAsYkOL"
},
......
......@@ -218,9 +218,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}else{
if (numTime <= 1) {
if (numTime == 1) this.playLocalAudio("time1")
if (numTime == 1) this.playLocalAudio("time1",false)
} else {
this.playLocalAudio("time2")
this.playLocalAudio("time2",false)
}
}
// }
......@@ -305,10 +305,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
} else {
this.canTouch = false
if (this.clickNodeData1.pairIdx == data.pairIdx) {
this.asyncPlayAudioByUrl(data.audio)
Promise
.all([node.getComponent("card").asyncDoFlip(), this.asyncPlayAudioByUrl(data.audio)])
.all([node.getComponent("card").asyncDoFlip()])
.then(() => {
Promise.all([node.getComponent("card").playDragon(), this.clickNode1.getComponent("card").playDragon(), this.playLocalAudio("true")])
this.playLocalAudio("true")
Promise.all([node.getComponent("card").playDragon(), this.clickNode1.getComponent("card").playDragon()])
.then(() => {
Promise.all([node.getComponent("card").doHide(), this.clickNode1.getComponent("card").doHide()])
.then(() => {
......@@ -337,18 +339,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
)
} else {
this.asyncPlayAudioByUrl(data.audio)
Promise
.all([node.getComponent("card").asyncDoFlip(), this.asyncPlayAudioByUrl(data.audio)])
.all([node.getComponent("card").asyncDoFlip()])
.then(() => {
Promise.all([this.playLocalAudio("false")])
.then(() => {
this.playLocalAudio("false")
// Promise.all([this.playLocalAudio("false")])
// .then(() => {
Promise.all([node.getComponent("card").asyncDoFlip(), this.clickNode1.getComponent("card").asyncDoFlip()])
.then(() => {
this.canTouch = true;
this.clickNode1 = null
this.clickNodeData1 = null;
})
})
// })
}
)
}
......@@ -397,10 +401,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
}
playLocalAudio(audioName) {
playLocalAudio(audioName,stopAll=true) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
cc.audioEngine.stopAll();
if(stopAll) cc.audioEngine.stopAll();
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
......
......@@ -3,8 +3,8 @@ export const defaultData = {
questionText: "题目说明题目说明题目说明题目说明题目说明题目说明题目说明",
questionTextAudio: "http://staging-teach.cdn.ireadabc.com/92ddbc65e9af775f7a8450a5bef1a732.mp3",
questions: [{
watchTime: 10, // 看题时间(秒)
gameTime: 30, // 游戏时间(秒)
watchTime: 5, // 看题时间(秒)
gameTime: 10, // 游戏时间(秒)
options: [{
pairIdx: 1,
audio: "http://staging-teach.cdn.ireadabc.com/ce3337620f22232dd15c29c66af57736.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