From 7345fc9a788f6c07b4d9ce66981a34de2275f6d2 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 19 Aug 2016 10:02:55 +0800 Subject: [PATCH] Fix event listener mask can't be set if node is not in the hierarchy --- cocos2d/core/CCNode.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 3eb80ebbe3..828c33bdfe 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -969,6 +969,12 @@ var Node = cc.Class({ // activate cc.director.getActionManager().resumeTarget(this); cc.eventManager.resumeTarget(this); + if (this._touchListener) { + this._touchListener.mask = _searchMaskParent(this); + } + if (this._mouseListener) { + this._mouseListener.mask = _searchMaskParent(this); + } } else { // deactivate