fix(scripts): emitPrefabJson rootNode._children 必须包含 group-X 节点 (Task 9 fix round 1)

This commit is contained in:
2026-09-02 08:36:51 +08:00
parent e8f4180483
commit 950ba4581c
2 changed files with 16 additions and 1 deletions
@@ -614,7 +614,9 @@ export function emitPrefabJson(layer) {
for (const g of groupParents) {
const node = makeNode(g.name, { __id__: rootId });
out.push(node);
groupInfo.push({ group: g, node, nodeId: out.length - 1 });
const nodeId = out.length - 1;
rootNode._children.push({ __id__: nodeId }); // wire group node into root._children (Task 9 fix round 1)
groupInfo.push({ group: g, node, nodeId });
}
// ── 4. Spirit 子节点 + 组件 ────────────────────────────────────