diff --git a/assets/module/common/CCEntity.ts b/assets/module/common/CCEntity.ts index 56d2880..9849688 100644 --- a/assets/module/common/CCEntity.ts +++ b/assets/module/common/CCEntity.ts @@ -74,11 +74,12 @@ export abstract class CCEntity extends ecs.Entity { * @param path 显示资源地址 * @param bundleName 资源包名称 */ - addPrefab(ctor: ECSCtor, parent: Node, path: string, bundleName: string = resLoader.defaultBundleName) { + addPrefab(ctor: ECSCtor, parent: Node, path: string, bundleName: string = resLoader.defaultBundleName): Node { const node = ViewUtil.createPrefabNode(path, bundleName); const comp = node.getComponent(ctor)!; this.add(comp); node.parent = parent; + return node; } /**