registerWithTouchDispatcher()在cocos3.0已经弃用, 该怎么做

CC_DEPRECATED_ATTRIBUTE virtual void registerWithTouchDispatcher() final 不允许重写 这个咋搞. 参见里面的说明 也看不出个所以然. 还是要请教官方权威人士.

this->setTouchMode(Touch::DispatchMode::ONE_BY_ONE);

auto listener = EventListenerTouchOneByOne::create();
listener->setSwallowTouches(true);
listener->onTouchBegan = CC_CALLBACK_2(HelloWorld::onTouchBegan, this);
listener->onTouchMoved = CC_CALLBACK_2(HelloWorld::onTouchMoved, this);
listener->onTouchEnded = CC_CALLBACK_2(HelloWorld::onTouchEnded, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);

3.0中使用EventListener类了,具体可学习下官方列子程序。