mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1455 from jareguo/v1.4
should not export unneed prefab asset while building
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///**
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user