代码如下:
cc.eventManager.addListener({
event: cc.EventListener.CUSTOM,
eventName: "test",
callback: (event)=> {
}}, 1);
jsb中是可以的,在web中报错误:
Uncaught Error: listener must be a cc.EventListener object when adding a fixed priority listener