cocos creator 3.6.0 eventTarget 的 removeAll 和 targetOff 有啥区别

测试下来,removeAll 和 targetOff的一模一样的,是我理解有问题吗?

 this.eventTarget = new EventTarget();
 this.node1 = new Node();
 this.node2 = new Node();
 this.node.addChild(this.node1)
 this.node.addChild(this.node2);
    this.eventTarget.on('run', this.log1, this);
    this.eventTarget.on('run', this.log2, this);
    this.eventTarget.on('run', this.log3, this.node1);
    this.eventTarget.on('run', this.log4, this.node2);

this.eventTarget.targetOff(this);
//this.eventTarget.targetOff(‘run’);
this.eventTarget.emit(‘run’);

或者
this.eventTarget.removeAll(this);
//this.eventTarget.removeAll(‘run’);
this.eventTarget.emit(‘run’);


:sweat_smile:

sou ga :rofl: :rofl: :rofl: