Commit 2d362bb8 authored by yu's avatar yu

1

parent cfa8eccf
...@@ -235,6 +235,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -235,6 +235,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
private onTouchCancel(e) { private onTouchCancel(e) {
if (!this.isClick || !this.touching) return;
let target: cc.Node = e.target; let target: cc.Node = e.target;
let question = Game.getIns().getCurrentPage(); let question = Game.getIns().getCurrentPage();
this.playWrongAudio(); this.playWrongAudio();
...@@ -245,21 +246,24 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -245,21 +246,24 @@ export default class SceneComponent extends MyCocosSceneComponent {
target.setPosition(0, 0); target.setPosition(0, 0);
} }
private isClick; private isClick;
private touching;
private onTouchStart(e) { private onTouchStart(e) {
if (!this.isClick) return; if (!this.isClick || this.touching) return;
this.touching = true;
let target: cc.Node = e.target; let target: cc.Node = e.target;
target.parent = this.node; target.parent = this.node;
this.setTouchPos(e); this.setTouchPos(e);
} }
private onTouchMove(e) { private onTouchMove(e) {
if (!this.isClick) return; if (!this.isClick || !this.touching) return;
let target: cc.Node = e.target; let target: cc.Node = e.target;
this.setTouchPos(e); this.setTouchPos(e);
} }
private onTouchEnd(e) { private onTouchEnd(e) {
if (!this.isClick) return; if (!this.isClick || !this.touching) return;
this.touching = false;
let target: cc.Node = e.target; let target: cc.Node = e.target;
let car = cc.find("spt_car/layout_item", this.layout_game); let car = cc.find("spt_car/layout_item", this.layout_game);
if (!car) return; if (!car) return;
......
{ {
"ver": "1.0.8", "ver": "1.0.8",
"uuid": "2aac122f-0244-4934-8c73-6279a92b7a02", "uuid": "1da43153-a1ab-4328-9a4b-338745196904",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": 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