我的3.0项目里 一个layer下同时点击两个按钮 发现两个按钮都出发了回调。
按钮类是我自己封装的
在按钮类的 构造函数中 添加了监听
_touchListener = EventListenerTouchOneByOne::create();
_touchListener->setEnabled(true);
_touchListener->setSwallowTouches(true);//设置是否想下传递触摸
_touchListener->onTouchBegan = CC_CALLBACK_1(UIBotton::touchbegan, this);
_touchListener->onTouchMoved = CC_CALLBACK_1(UIBotton::touchmove, this);
_touchListener->onTouchEnded = CC_CALLBACK_1(UIBotton::touchend, this);
_touchListener->onTouchCancelled = CC_CALLBACK_1(UIBotton::touchcancell, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(_touchListener ,this);
OneByOne不是单点的么
还有 我用的是onTouchBegan 而不是onTouchesBegan
求各路大神指导指导!!!


