fix(entity): remove redundant self-name prefix check in _findChildByName method

This commit is contained in:
chenmo.gl
2026-04-22 19:45:27 +08:00
parent ae8c7db08d
commit 569c062a24

View File

@@ -375,14 +375,6 @@ export class Entity extends EngineObject {
return this;
}
// Some imported animation clips are normalized to include the single scene root
// name (for example "mixamorig:Hips/..."), while the Animator may already sit on
// that root entity. Accept a self-name prefix so wrapped model roots and
// standalone single-root clips resolve through the same path convention.
if (splits[0] === this.name) {
return splits.length === 1 ? this : Entity._findChildByName(this, 0, splits, 1);
}
return Entity._findChildByName(this, 0, splits, 0);
}