diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index ece1d4a470..775cf65859 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -419,6 +419,18 @@ var Node = cc.Class({ this._objFlags &= ~DontDestroy; } } + }, + + groupIndex: 0, + + group: { + get: function () { + return cc.game.groupList[this.groupIndex] || ''; + }, + + set: function (value) { + this.groupIndex = cc.game.groupList.indexOf(value); + } } },