cocos2d-js3.1版本触摸机制遇到问题了

我在init函数里加入

if( ‘touches’ in cc.sys.capabilities ) {
// this is the default behavior. No need to set it explicitly.
cc.eventManager.addListener({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
onTouchesBegan: this.onTouchesBegan
}, this);
} else {
cc.log(“TOUCHES not supported”);
}

在手机上测试,没有监听事件

请问这是什么原因呢,大神快来救救我吧

哈哈,我终于找到原因了,是因为我加载的cocostudio资源的层级问题
监听的是this层,所以加载的资源要放到-1层