fix: scene root mark as template (#2251)

This commit is contained in:
luzhuang
2024-07-22 11:10:20 +08:00
committed by GitHub
parent 0e70bffe55
commit 4a498cd052

View File

@@ -34,6 +34,8 @@ export class GLTFSceneParser extends GLTFParser {
sceneRoot = context.get<Entity>(GLTFParserType.Entity, sceneNodes[0]);
} else {
sceneRoot = new Entity(engine, "GLTF_ROOT");
// @ts-ignore
sceneRoot._markAsTemplate(glTFResource);
for (let i = 0; i < sceneNodes.length; i++) {
const childEntity = context.get<Entity>(GLTFParserType.Entity, sceneNodes[i]);
sceneRoot.addChild(childEntity);