cocos2d-x 3.2 注册触摸无法响应

auto listener = EventListenerTouchOneByOne::create();

listener->setSwallowTouches(true);

listener->onTouchBegan = CC_CALLBACK_2(GameScene::onTouchBegan, this);
listener->onTouchEnded = CC_CALLBACK_2(GameScene::onTouchEnded, this);

_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);

void GameScene::onTouchEnded(Touch * touch, Event * event){
auto touch1 = touch->getLocation();

log("%f %f",touch1.y,touch1.x);

}
void GameScene::onTouchEnded(Touch * touch, Event * event){
auto touch1 = touch->getLocation();

log("%f %f",touch1.y,touch1.x);

}
bool GameScene::onTouchBegan(Touch * touch, Event * event){
auto touch1 = touch->getLocation();

log("%f %f",touch1.y,touch1.x);
return true;

}

如上代码部分 无法响应 不知道是哪里有问题 望大神不吝赐教

你是在init()方法还是onEnter()方法中注册的监听?

你这个能编译过去???改成CC_CALLBACK_1就能有反应了