From 1b841bb31ffecad3da91bcfa77f833ec8880e286 Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Mon, 26 Dec 2016 12:40:36 +0800 Subject: [PATCH] fileId of child of prefab should not cloned from existing node --- cocos2d/core/CCNode.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 98e26aa366..c5dac1d7e5 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -1089,6 +1089,11 @@ var Node = cc.Class({ } var thisPrefabInfo = this._prefab; + if (CC_EDITOR && thisPrefabInfo) { + if (this !== thisPrefabInfo.root) { + _Scene.PrefabUtils.initClonedChildOfPrefab(cloned); + } + } var syncing = thisPrefabInfo && this === thisPrefabInfo.root && thisPrefabInfo.sync; if (syncing) { // copy non-serialized property