Commit 9f04ce0b authored by 李维's avatar 李维

清除setTimeout

parent 804ad5ef
...@@ -184,6 +184,9 @@ cc.Class({ ...@@ -184,6 +184,9 @@ cc.Class({
console.log('showGameOver'); console.log('showGameOver');
// this.moveGrassInterval // this.moveGrassInterval
clearInterval(this.moveGrassInterval); clearInterval(this.moveGrassInterval);
this.timeoutsIds.forEach(id=>{
clearTimeout(id)
})
cc.director.loadScene('sn11_zmxz_end'); cc.director.loadScene('sn11_zmxz_end');
}, },
...@@ -408,6 +411,7 @@ cc.Class({ ...@@ -408,6 +411,7 @@ cc.Class({
imgCharactor.scale = 1; imgCharactor.scale = 1;
}, },
timeoutsIds: [],
showOptions() { showOptions() {
const nodeOptions = cc.find('Canvas/NodeOptions'); const nodeOptions = cc.find('Canvas/NodeOptions');
nodeOptions.zIndex = 10; nodeOptions.zIndex = 10;
...@@ -425,6 +429,7 @@ cc.Class({ ...@@ -425,6 +429,7 @@ cc.Class({
nodeOption.scale = 1; nodeOption.scale = 1;
const btnOption = cc.find(`Canvas/NodeOptions/NodeOption_${i}/BtnOption`) const btnOption = cc.find(`Canvas/NodeOptions/NodeOption_${i}/BtnOption`)
this.timeoutsIds.push(
setTimeout(() => { setTimeout(() => {
cc.tween(btnOption) cc.tween(btnOption)
.by(2.5, { y: 20 }, { easing: 'cubicInOut' }) .by(2.5, { y: 20 }, { easing: 'cubicInOut' })
...@@ -432,7 +437,7 @@ cc.Class({ ...@@ -432,7 +437,7 @@ cc.Class({
.union() .union()
.repeatForever() .repeatForever()
.start(); .start();
}, Math.random() * 2000); }, Math.random() * 2000));
const label = cc.find(`Canvas/NodeOptions/NodeOption_${i}/BtnOption/LabelOption`) const label = cc.find(`Canvas/NodeOptions/NodeOption_${i}/BtnOption/LabelOption`)
label.getComponent(cc.Label).string = wordList[i]; label.getComponent(cc.Label).string = wordList[i];
......
module.exports = { module.exports = {
roundList: [{ "bgAudio": true,
audio: 'ball', "roundList": [
questionList: [{ {
rightAudio: 'b', "audio": "http://staging-teach.cdn.ireadabc.com/ec19a2c73ec4fca0bf0458c74381a702.mp3",
rightWord: 'b', "questionList": [
wrongWordList: ['p', 'd'], {
wrongAudioList: ['p.mp3', 'd.mp3'], "rightAudio": "http://staging-teach.cdn.ireadabc.com/b4673919e9942df87851ad70fae5d5ba.mp3",
}, { "rightWord": "j",
rightAudio: 'a', "wrongWordList": [
rightWord: 'all', "r",
wrongWordList: ['ao', 'arl'], "t"
wrongAudioList: ['ao.mp3', 'arl.mp3'], ],
}] "wrongAudioList": [
}], "http://staging-teach.cdn.ireadabc.com/59a72e6ecfa057f8f6da2626a96d3669.mp3",
} "http://staging-teach.cdn.ireadabc.com/163441a48b0325b021baddfa3cdc1f3d.mp3"
]
},
{
"rightAudio": "http://staging-teach.cdn.ireadabc.com/3a2459fbf41e71d847dbc1e1d8344174.mp3",
"rightWord": "i",
"wrongWordList": [
"c",
"o"
],
"wrongAudioList": [
"http://staging-teach.cdn.ireadabc.com/46d0c82dfa618ae6e375dd6353cd7323.mp3",
"http://staging-teach.cdn.ireadabc.com/937fc595d0bd23321fc3559a97e0aa55.mp3"
]
}
]
}
]
}
\ No newline at end of file
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