使用如下代码创建触摸事件,并挂在在一个按钮组件上
this.node.on(Node.EventType.TOUCH_START, (event) => {
console.log('触摸开始')
let w_pos = event.getUILocation()
let n_pos = this.node.getComponent(UITransform).convertToNodeSpaceAR(w_pos)
this.stickNode.setPosition(n_pos)
}, this)
点击按钮就消失,是怎么回事