diff --git a/cocos2d/core/platform/deserialize.js b/cocos2d/core/platform/deserialize.js index 172b93886c..907ab106ae 100644 --- a/cocos2d/core/platform/deserialize.js +++ b/cocos2d/core/platform/deserialize.js @@ -441,6 +441,21 @@ var _Deserializer = (function () { Object.defineProperty(klass, '__deserialize__', { value: deserialize, writable: true }); } deserialize(self, obj, serialized, klass, target); + + // HACK: remove unneeded asset property + if (/* preview or build */ + CC_DEV && (!CC_EDITOR || self._ignoreEditorOnly) && + klass === cc._PrefabInfo && !obj.sync) { + var uuid = serialized['asset'] && serialized['asset'].__uuid__; + if (uuid) { + var index = self.result.uuidList.indexOf(uuid); + if (index !== -1) { + JS.array.fastRemoveAt(self.result.uuidList, index); + JS.array.fastRemoveAt(self.result.uuidObjList, index); + JS.array.fastRemoveAt(self.result.uuidPropList, index); + } + } + } } ///** diff --git a/cocos2d/core/utils/prefab-helper.js b/cocos2d/core/utils/prefab-helper.js index cc4720144b..74c21f8d21 100644 --- a/cocos2d/core/utils/prefab-helper.js +++ b/cocos2d/core/utils/prefab-helper.js @@ -23,15 +23,9 @@ THE SOFTWARE. ****************************************************************************/ -// 保存编辑器下用到的 prefab 相关信息 cc._PrefabInfo = cc.Class({ name: 'cc.PrefabInfo', properties: { - //// the serialized version - //VER: { - // default: 1 - //}, - // the most top node of this prefab in the scene root: null,