cocos creater touch事件物体跟随鼠标移动(亲测可用)
按需要增减代码
onLoad () {
this.node.on(‘touchstart’,this.onTouchStart,this);
this.node.on(‘touchmove’,this.onTouchMove,this);
}
onDestroy(){
this.node.off(‘touchstart’,this.onTouchStart,this);
}
onTouchStart(e){
console.log(‘点击开始’);
}
onTouchMove(e){
let delta=e
原创
2021-11-17 14:19:14 ·
685 阅读 ·
0 评论