节点隐藏再显示,暂停的会自动恢复,引擎就是样设计的么
测试代码
import { _decorator, Component, Node, NodeEventType } from ‘cc’;
const { ccclass, property } = _decorator;
@ccclass('ttttt')
export class ttttt extends Component {
onLoad() {
this.node.on(NodeEventType.TOUCH_END, this.test, this)
setTimeout(() => {
this.node.active = false;
}, 2000)
setTimeout(() => {
this.node.active = true;
}, 3000)
}
start() {
this.node.pauseSystemEvents(false);
}
test() {
console.warn('testTouch');
}
update(deltaTime: number) {
}
}
按钮禁用,touch事件还会触发,本来是在interactable属性改变的时候暂停派发,谁知道有这么个坑;
另外附带吐槽一下,按钮禁用,touch事件还能触发这个也是不太能理解