Skip to content

Commit

Permalink
fixed the findCamera problem
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinCollins committed Dec 17, 2018
1 parent eef64f2 commit 7016509
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cocos2d/core/camera/CCCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,16 @@ let Camera = cc.Class({
* @return {Boolean}
*/
containsNode (node) {
return node._cullingMask & this.cullingMask;
let groupIndex = this._getGroupIndex(node);
return (1 << groupIndex) & this.cullingMask;
},
// get the groupIndex
_getGroupIndex (node) {
let groupIndex = node.groupIndex;
if (groupIndex === 0 && node.parent) {
groupIndex = this._getGroupIndex(node.parent);
}
return groupIndex;
},

/**
Expand Down

0 comments on commit 7016509

Please sign in to comment.