[已解决]cocostudio 加载layer之后onTouchEnded失效

如题,如果没有加载Layer的话,onTouchEnded是可以用的,但是加载过的Layer之后,onTouchEnded就不能用了,求大神辞招。
cocostudio::GUIReader::getInstance()->widgetFromJsonFile(“ui/TempLayer_1.ExportJson”);

bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
{
return false;
}

//////////////////////////////////////////////////////////////////////////
// 变量初始化区域
Size visibleSize = Director::getInstance()->getVisibleSize();   
Vec2 origin      = Director::getInstance()->getVisibleOrigin(); 

//////////////////////////////////////////////////////////////////////////
// 添加屏幕点击事件
auto touchListener = EventListenerTouchOneByOne::create();
touchListener->onTouchBegan = CC_CALLBACK_2(HelloWorld::onTouchBegan, this);
touchListener->onTouchEnded = CC_CALLBACK_2(HelloWorld::onTouchEnded, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);

ArmatureDataManager::getInstance()->addArmatureFileInfo("Ani/tauren.ExportJson");  

auto UI = cocostudio::GUIReader::getInstance()->widgetFromJsonFile("ui/TempLayer_1.ExportJson");
this->addChild(UI);

Helper::seekWidgetByName(UI, "Button_up")->addTouchEventListener(this, toucheventselector(HelloWorld::hero_jump));
Helper::seekWidgetByName(UI, "Button_down")->addTouchEventListener(this, toucheventselector(HelloWorld::hero_jump));
Helper::seekWidgetByName(UI, "Button_right")->addTouchEventListener(this, toucheventselector(HelloWorld::move_to_right));

Helper::seekWidgetByName(UI, "Button_new")->addTouchEventListener(this, toucheventselector(HelloWorld::hero_new));

m_player = PlayerHero::create();
m_player->setPosition(Point(visibleSize.width * 0.5f, visibleSize.height * 0.85f));
this->addChild(m_player);


auto contactListener = EventListenerPhysicsContact::create();
contactListener->onContactBegin = CC_CALLBACK_1(HelloWorld::onContactBegin, this);  
this->getEventDispatcher()->addEventListenerWithSceneGraphPriority(contactListener,this);

return true;

}

bool HelloWorld::onTouchBegan(Touch *touch, Event *unused_event)
{
return true;
}

void HelloWorld::onTouchEnded(Touch *touch, Event *unused_event)
{
auto location = touch->getLocation();
addNewSpriteAtPosition(location);
}

:904:

你好,你的UI根节点设置了可触摸属性,导致拦截了场景的事件。

哈哈,果然,谢谢拉。把可触摸去掉果然就好了。