Commit ec15d39b authored by LMZ's avatar LMZ

fix: 销毁处理

parent b7cbeb79
No preview for this file type
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
}, },
"isRemoteBundle": { "isRemoteBundle": {
"ios": true, "ios": true,
"android": true, "android": true
"web-desktop": false
}, },
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
...@@ -301,14 +301,26 @@ cc.Class({ ...@@ -301,14 +301,26 @@ cc.Class({
} }
window.courseware.onEvent('clickOption', async (data, next) => { window.courseware.onEvent('clickOption', async (data, next) => {
await this.showOption(data.data.idx); await this.showOption(data.data.idx);
if (this.isDestroy) {
return;
}
await this.hideOption(); await this.hideOption();
if (this.isDestroy) {
return;
}
this.updateStatus(data.status); this.updateStatus(data.status);
this.clickedBtn = false; this.clickedBtn = false;
next(); next();
}); });
window.courseware.onEvent('clickQuestion', async (data, next) => { window.courseware.onEvent('clickQuestion', async (data, next) => {
await this.showQuestion(); await this.showQuestion();
if (this.isDestroy) {
return;
}
await this.hideQuestion(); await this.hideQuestion();
if (this.isDestroy) {
return;
}
this.updateStatus(data.status); this.updateStatus(data.status);
this.clickedBtn = false; this.clickedBtn = false;
next(); next();
...@@ -489,6 +501,9 @@ cc.Class({ ...@@ -489,6 +501,9 @@ cc.Class({
await asyncTweenTo(label, 0.15, { scale: 1.1 }, { easing: 'sineIn' }); await asyncTweenTo(label, 0.15, { scale: 1.1 }, { easing: 'sineIn' });
await asyncTweenTo(label, 0.1, { scale: 1 }, { easing: 'sineOut' }); await asyncTweenTo(label, 0.1, { scale: 1 }, { easing: 'sineOut' });
await asyncDelay(2); await asyncDelay(2);
if (this.isDestroy) {
return;
}
}, },
async hideOption() { async hideOption() {
...@@ -556,6 +571,9 @@ cc.Class({ ...@@ -556,6 +571,9 @@ cc.Class({
await asyncTweenTo(label, 0.2, { scale: 1.0 }, { easing: 'sineInOut' }); await asyncTweenTo(label, 0.2, { scale: 1.0 }, { easing: 'sineInOut' });
} }
await asyncDelay(2); await asyncDelay(2);
if (this.isDestroy) {
return;
}
}, },
async hideQuestion() { async hideQuestion() {
...@@ -621,6 +639,9 @@ cc.Class({ ...@@ -621,6 +639,9 @@ cc.Class({
const audioId = cc.audioEngine.play(audioClip, false, 0.8); const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) { if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => { cc.audioEngine.setFinishCallback(audioId, () => {
if (this.isDestroy) {
return;
}
cb(); cb();
}); });
} }
...@@ -628,6 +649,14 @@ cc.Class({ ...@@ -628,6 +649,14 @@ cc.Class({
} }
}, },
isDestroy: null,
onDestroy() {
this.isDestroy = true;
cc.Tween.stopAll();
},
// ------------------------------------------ // ------------------------------------------
}); });
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
"packages": "packages", "packages": "packages",
"name": "play", "name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231", "id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.5", "version": "2.4.4",
"isNew": false "isNew": false
} }
\ No newline at end of file
No preview for this file type
{"ios":{"sceneName":"AK09","version":"11da0"},"android":{"sceneName":"AK09","version":"11da0"}} {"ios":{"sceneName":"AK09","version":"461d4"},"android":{"sceneName":"AK09","version":"461d4"}}
\ No newline at end of file \ 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