xx 1 рік тому
батько
коміт
4e536ac8ca
1 змінених файлів з 5 додано та 4 видалено
  1. 5 4
      assets/script/game/touch.ts

+ 5 - 4
assets/script/game/touch.ts

@@ -20,14 +20,15 @@ export class touch extends Component {
             //     n.getComponent(Sprite).color = Color.RED
             //     this.start_node = n
             // }
-            this.start_node = et.getUILocation()
-        },this)
-
-        this.node.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
             if(this.CurTouchId!=-1&&this.CurTouchId!=et.getID()){
                 return
             }
             this.CurTouchId = et.getID()
+            this.start_node = et.getUILocation()
+        },this)
+
+        this.node.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
+
             if(this.start_node!=null){
                 // let n = this.getClickPos(et.getUILocation().x)
                 // if(n!=null&&n!=this.start_node){