Commit 67198bab authored by limingzhe's avatar limingzhe

fix: 销毁处理

parent 0cd1f6b4
No preview for this file type
......@@ -228,6 +228,11 @@ cc.Class({
// 随机亮起一个题干
showRandomQuestion() {
if (this.isDestroy) {
return;
}
GameData.currOptionIndex = this.optionList[Math.floor(Math.random() * this.optionList.length)]
let question = this.nodeDict.nodQuestionParent.children[GameData.currOptionIndex];
let ItemQuestion = question.getComponent('ItemQuestion');
......@@ -336,4 +341,8 @@ cc.Class({
}
},
onDestroy() {
this.isDestroy = true;
}
});
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