父节点背景有一个拖拽事件,当鼠标在子节点上面的时候 会盖住父节点的拖拽事件,想让 子节点的点击事件跟父节点的拖拽时间并存
event.preventSwallow = true;
加载子节点的点击事件上试试
加上不管用呢
怎么这个触摸事件一直穿透不了,Move事件才可以穿透 是为什么
paota.on(Input.EventType.TOUCH_MOVE, this.test2, this)
this.node.on(Input.EventType.TOUCH_MOVE, this.test3, this)
test2(event:EventTouch){
event.preventSwallow = true
console.log("我是按钮")
}
test3(event){
console.log("我是背景")
}
如果子节点是按钮(有 button 组件)的话,引擎有做禁止穿透的处理
好的 谢谢