1 |
- {"version":3,"sources":["file:///D:/yyy/al/cocos_pro/plane_demo/assets/script/self-plane.ts"],"names":["_decorator","Component","input","Input","ccclass","property","self_plane","start","on","EventType","TOUCH_MOVE","_touchMove","event","delta","getDelta","pos","node","position","setPosition","x","speed","y","z"],"mappings":";;;;;;;;;;;;;;;;AAASA,MAAAA,U,OAAAA,U;AAAYC,MAAAA,S,OAAAA,S;AAAiBC,MAAAA,K,OAAAA,K;AAAOC,MAAAA,K,OAAAA,K;;;;;;;;;OACvC;AAAEC,QAAAA,OAAF;AAAWC,QAAAA;AAAX,O,GAAwBL,U;;4BAGjBM,U,WADZF,OAAO,CAAC,YAAD,C,2BAAR,MACaE,UADb,SACgCL,SADhC,CAC0C;AAAA;AAAA;;AAAA;AAAA;;AAMtCM,QAAAA,KAAK,GAAG;AACJ;AACAL,UAAAA,KAAK,CAACM,EAAN,CAASL,KAAK,CAACM,SAAN,CAAgBC,UAAzB,EAAqC,KAAKC,UAA1C,EAAsD,IAAtD;AACH,SATqC,CAYtC;AAEA;;;AACAA,QAAAA,UAAU,CAACC,KAAD,EAAoB;AAC1B,gBAAMC,KAAK,GAAGD,KAAK,CAACE,QAAN,EAAd;AACA,cAAIC,GAAG,GAAG,KAAKC,IAAL,CAAUC,QAApB,CAF0B,CAG1B;AACA;;AACA,eAAKD,IAAL,CAAUE,WAAV,CAAsBH,GAAG,CAACI,CAAJ,GAAQ,OAAO,KAAKC,KAAZ,GAAoBP,KAAK,CAACQ,CAAxD,EAA2DN,GAAG,CAACM,CAA/D,EAAkEN,GAAG,CAACO,CAAJ,GAAQ,OAAO,KAAKF,KAAZ,GAAoBP,KAAK,CAACM,CAApG;AACH;;AArBqC,O,wEAErCd,Q;;;;;iBACc,C","sourcesContent":["import { _decorator, Component, Node, input, Input, EventTouch } from 'cc';\r\nconst { ccclass, property } = _decorator;\r\n\r\n@ccclass('self_plane')\r\nexport class self_plane extends Component {\r\n\r\n @property\r\n public speed = 1;\r\n\r\n\r\n start() {\r\n // input.on(Input.EventType.TOUCH_START, this._touchStart, this);\r\n input.on(Input.EventType.TOUCH_MOVE, this._touchMove, this);\r\n }\r\n\r\n\r\n // update(deltaTime: number) {\r\n\r\n // }\r\n _touchMove(event: EventTouch) {\r\n const delta = event.getDelta();\r\n let pos = this.node.position;\r\n // x 上下, z 左右 \r\n // this.node.setPosition(pos.x - 0.01 * this.speed * delta.x, pos.y, pos.z - 0.01 * this.speed * delta.y)\r\n this.node.setPosition(pos.x + 0.01 * this.speed * delta.y, pos.y, pos.z + 0.01 * this.speed * delta.x)\r\n }\r\n}\r\n\r\n\r\n"]}
|