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

Function processSceneAsset

src/core/resourceProcessor.js:457–484  ·  view source on GitHub ↗

* 处理场景资源 * @param {Object} data 场景数据 * @param {string} index 索引 * @param {string} key 键名

(data, index, key)

Source from the content-addressed store, hash-verified

455 const raw = this._rawAssetMap.get(String(uuidKey))
456 || this._rawAssetMap.get(String(uuid))
457 || this._rawAssetMap.get(this.expandUuidRef(uuidKey));
458
459 let dir = 'Prefab';
460 let filename = `${name}.prefab`;
461 if (raw && raw.path) {
462 const base = path.basename(raw.path, path.extname(raw.path)) + '.prefab';
463 const sub = path.dirname(raw.path).replace(/\\/g, '/');
464 if (sub && sub !== '.') dir = path.posix.join('Prefab', sub);
465 filename = base;
466 }
467
468 this.enqueueWrite(dir, filename, doc);
469 this.enqueueWrite(dir, `${filename}.meta`, {
470 ver: '1.2.7',
471 uuid,
472 optimizationPolicy: 'AUTO',
473 asyncLoadAssets: false,
474 readonly: false,
475 subMetas: {},
476 });
477 },
478
479 /**
480 * 兼容旧路径:reveal + writeProcessedData
481 */
482 async processData(key, data) {
483 if (!global.settings || this.isEmptyObject(global.settings)) {
484 logger.warn('全局设置为空,跳过数据处理');
485 return;
486 }
487 const processedData = await this.revealData(data);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected