* 处理音频资源 * @param {Object} data 音频数据 * @param {string} key 键名
(data, key)
| 378 | if (Array.isArray(item)) { |
| 379 | // Nested document (scene / prefab) — keep local __id__ space, do NOT |
| 380 | // resolveReferences across the outer pack. |
| 381 | this.processDocumentArray(item, uuid); |
| 382 | } else if (item && typeof item === 'object') { |
| 383 | if (item.__type__) { |
| 384 | this.decodeUuids(item); |
| 385 | this.dispatchAsset(item, uuid, item); |
| 386 | } else if (item.type === 'cc.Texture2D') { |
| 387 | // skip |
| 388 | } else { |
| 389 | // unknown object — still try decode |
| 390 | this.decodeUuids(item); |
| 391 | } |
| 392 | } |
| 393 | } |
| 394 | }, |
| 395 | |
| 396 | /** |
| 397 | * 处理共享 __id__ 的文档数组(场景 / 预制体) |
| 398 | * 保留 {__id__},只解码 uuid。 |
| 399 | */ |
| 400 | processDocumentArray(doc, uuidKey) { |
| 401 | if (!Array.isArray(doc) || doc.length === 0) return; |
| 402 | |
| 403 | // Deep clone so we never mutate nodeData / shared pack entries |
| 404 | const clone = JSON.parse(JSON.stringify(doc)); |
| 405 | this.decodeUuids(clone); |
| 406 | |
| 407 | const root = clone[0]; |
nothing calls this directly
no outgoing calls
no test coverage detected