void MyBulletLayer::onEnter()
{
Layer::onEnter();
this->scheduleUpdate();
setTouchEnabled( true );
//设置为单点触摸
setTouchMode(Touch::DispatchMode::ONE_BY_ONE);
}
默认是多点触摸,所以不改变触摸模式,不能进入函数
bool MyBulletLayer::onTouchBegan(Touch *touch,Event *unused_event)
原文链接:https://www.f2er.com/cocos2dx/345778.html