Commit 7906653e authored by yu's avatar yu

1

parent f3a5ca6d
......@@ -212,6 +212,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();
target.parent = this.layout_word;
......@@ -219,19 +220,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