Commit ed67cc90 authored by Tt's avatar Tt

处理乱点不能点击问题

parent bddd536d
......@@ -109,7 +109,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.gameOver();
return;
}
this.canTouch = true;
//TODO: 需要增加总倒计时
this.currentQuestion.options = this.currentQuestion.options.map((op, i) => {
op.id = i;
......@@ -121,6 +120,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.rightList = [];
this.onTouchAudio(false).then(() => {
this.canTouch = true;
this.inited = true;
this.startQuestion();
})
......@@ -163,11 +163,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
touchPaoPao(e: any) {
// 点击之后不能再次点击
if (!this.canTouch) return;
console.log("canTouch 0:" + this.canTouch)
this.canTouch = false;
// 如果泡泡没有到指定位置不允许点击
let item = e.target;
let data = e.target.data;
if (!data) return;
if (!data) {
this.canTouch = true;
return;
}
if (data.right) {
pg.hw.playLocalAudio('right2');
this.scheduleOnce(() => {
......@@ -179,6 +183,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.rightList.push(data);
this.updatePaoPaoRight(item, data).then(() => {
console.log("canTouch 1:" + this.canTouch)
this.canTouch = true;
if (this.rightList.length == this.currentRightList.length) {
this.freeArea.forEach((item) => {
......@@ -193,6 +198,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 失败
pg.hw.playLocalAudio('error')
this.updatePaoPaoError(item, data).then(() => {
console.log("canTouch 2:" + this.canTouch)
this.canTouch = true;
})
}
......
{
"ver": "1.1.2",
"uuid": "93731c49-28d4-4208-9880-d1c9fb139190",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ 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