Sfoglia il codice sorgente

修复文档的bug

FantasyUFG 4 anni fa
parent
commit
629eb0b039
1 ha cambiato i file con 6 aggiunte e 7 eliminazioni
  1. 6 7
      assets/script/Game/Touch.js

+ 6 - 7
assets/script/Game/Touch.js

@@ -22,13 +22,12 @@ cc.Class({
         this.calcDir();
         this.calcDir();
     },
     },
     update(dt) {
     update(dt) {
-        this.scheduleOnce(function() {
-            if (this.GameMode._gamestart) {
-                this.node.on(cc.Node.EventType.TOUCH_START, this.ontouch_start, this);
-                this.node.on(cc.Node.EventType.TOUCH_END, this.ontouch_End, this);
-
-            }
-        }, 4);
+        // this.scheduleOnce(function() {
+        if (this.GameMode._gamestart) {
+            this.node.on(cc.Node.EventType.TOUCH_START, this.ontouch_start, this);
+            this.node.on(cc.Node.EventType.TOUCH_END, this.ontouch_End, this);
+        }
+        // }, 4);
     },
     },
     calcDir: function() {
     calcDir: function() {
         let dirvecX = this.touchEndPoint.x - this.touchStartPoint.x;
         let dirvecX = this.touchEndPoint.x - this.touchStartPoint.x;