MCPcopy Create free account
hub / github.com/Crain99/cc-reverse / writeProcessedData

Function writeProcessedData

src/core/resourceProcessor.js:352–372  ·  view source on GitHub ↗

* 写入处理后的数据 * @param {Object} data 处理后的数据 * @param {string} key 键名

(data, key)

Source from the content-addressed store, hash-verified

350 }
351 },
352
353 /**
354 * 对象数组且首项是 SceneAsset/Prefab → 整文档共享 __id__
355 */
356 isDocumentArray(arr) {
357 if (!Array.isArray(arr) || arr.length === 0) return false;
358 const first = arr[0];
359 if (!first || typeof first !== 'object' || Array.isArray(first)) return false;
360 const t = first.__type__;
361 return t === 'cc.SceneAsset' || t === 'cc.Prefab' || t === 'cc.Scene';
362 },
363
364 /**
365 * packed import:逐项拆出独立资源
366 */
367 async processPackedImport(packKey, items) {
368 const uuidRefs = this._packedMap[packKey] || [];
369
370 for (let i = 0; i < items.length; i += 1) {
371 const item = items[i];
372 if (item == null) continue;
373
374 const uuidRef = uuidRefs[i] != null ? uuidRefs[i] : `${packKey}_${i}`;
375 const compact = this.expandUuidRef(uuidRef);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected