Commit f69f260e authored by yu's avatar yu

1

parent 79a6bba0
......@@ -219,6 +219,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
target.active = false;
}
private onTouchCancel(e) {
if (!this.isClick || !this.touching) return;
let target: cc.Node = e.target;
this.playWrongAudio();
let data = target.data;
......@@ -226,19 +227,22 @@ export default class SceneComponent extends MyCocosSceneComponent {
target.setPosition(data.pos);
}
private isClick;
private touching;
private onTouchStart(e) {
if (!this.isClick) return;
if (!this.isClick || this.touching) return;
this.touching = true;
let target: cc.Node = e.target;
target.parent = this.node;
this.setTouchPos(e);
}
private onTouchMove(e) {
if (!this.isClick) return;
if (!this.isClick || !this.touching) return;
let target: cc.Node = e.target;
this.setTouchPos(e);
}
private onTouchEnd(e) {
if (!this.isClick) return;
if (!this.isClick || !this.touching) return;
this.touching = false;
let target: cc.Node = e.target;
let data = target.data;
let item: any = this.layout_box.children.find((ch) => {
......
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