3.6 版本on 事件,节点禁用后重新激活 事件不管用了呢
在scrollview组件下 cacelInnerEvents没有勾选
this.test2.active = !this.test2.active; // 先禁用,后再激活
this.test2.on(Node.EventType.TOUCH_END, this.test222, this);
// 重新激活后,不能触发
test222(){cc.log(“eee”)}
3.6 版本on 事件,节点禁用后重新激活 事件不管用了呢
在scrollview组件下 cacelInnerEvents没有勾选
this.test2.active = !this.test2.active; // 先禁用,后再激活
this.test2.on(Node.EventType.TOUCH_END, this.test222, this);
// 重新激活后,不能触发
test222(){cc.log(“eee”)}
你可以利用生命周期 onEnable 激活 onDisable 禁用