You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
599 B
19 lines
599 B
|
|
const { ccclass,property } = cc._decorator;
|
|
/** 疏通输入事件,该组件要放在包含监听触摸事件组件的后面 */
|
|
@ccclass
|
|
export default class UnchokeInputEvents extends cc.Component {
|
|
/** 是否吞噬事件 */
|
|
@property()
|
|
isSwallow: boolean = true;
|
|
|
|
onEnable() {
|
|
this.scheduleOnce(()=>{
|
|
console.log("this.node.name ==",this.node.name)
|
|
if (this.node['_touchListener']) {
|
|
console.log("touchListener进入")
|
|
this.node['_touchListener'].setSwallowTouches(this.isSwallow);
|
|
}
|
|
},0)
|
|
}
|
|
} |