Commit ec15d39b authored by LMZ's avatar LMZ

fix: 销毁处理

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