From 91ae92203e95f3aff3338b1bf01d74da2b3296cb Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Mon, 9 May 2016 23:42:55 +0800 Subject: [PATCH] add group for node --- cocos2d/core/CCNode.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); + } } },