![]()
onLoad() {
this.node.on(cc.Node.EventType.TOUCH_START, this.TouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.TouchMove, this);
this.node.on(cc.Node.EventType.TOUCH_END, this.TouchEnd, this);
this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.TouchCancel, this);
(this.node as any)._touchListener.setSwallowTouches(false);
}
想要做按钮事件穿透功能
爬文找到了
(this.node as any)._touchListener.setSwallowTouches(false);
这个方法
透过console.log检查时SwallowTouches的属性也确实为false
但是我仍然点击不到Button物件(该物件挂载的是cc.Button组件)
SwallowTouches好像不起作用
onLoad这个function的script则是挂在Slide物件上
拜託各路大神求解…
