mirror of
https://github.com/HappyLifeOk/cc-3-8-x-mcp.git
synced 2026-08-23 06:57:34 +00:00
[cc-3-8-x-mcp] 修复: 补全离线 CLI 解析路径与自包含夹具
改了什么:解析结果记录资源来源路径,并生成独立 Prefab、嵌套资源和脚本夹具。 为什么:测试依赖外部项目资源和临时目录时会导致嵌套解析与类 ID 结果不稳定。 影响范围:离线 CLI 解析、组件引用错误信息及 offline tools 测试。
This commit is contained in:
@@ -92,7 +92,7 @@ function execSetComponentRef(prefabData, op) {
|
||||
|
||||
const comp = findComponent(elements, node, componentType);
|
||||
if (!comp) {
|
||||
throw new Error(`editPrefab [set-component-ref]: 节点 "${node._name}" 未挂 "${componentType}" 组件`);
|
||||
throw new Error(`editPrefab [set-component-ref]: 节点 "${node._name}" 未挂 "${rawComponentType}" 组件`);
|
||||
}
|
||||
|
||||
const { node: refNode, nodeId: refNodeId } = resolveNode(prefabData, refNodeSelector, 'set-component-ref');
|
||||
|
||||
@@ -153,6 +153,9 @@ function parsePrefab(filePath) {
|
||||
raw,
|
||||
elements,
|
||||
rootId,
|
||||
// 解析结果可直接交给 overrides/nested helpers 使用;调用方不应再被迫
|
||||
// 手工补一遍来源路径。editPrefab 仍可用 options.projectRoot 覆盖它。
|
||||
resolverStartPath: filePath,
|
||||
findNodeByName,
|
||||
findNodesByType,
|
||||
getRoot,
|
||||
|
||||
Reference in New Issue
Block a user