From fe05f4cabc41e4689e4beb00b15406d0c18fff01 Mon Sep 17 00:00:00 2001 From: dgflash Date: Sat, 11 Oct 2025 10:17:51 +0800 Subject: [PATCH] =?UTF-8?q?CCEntity.addPrefab=E6=96=B9=E6=B3=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=BF=94=E5=9B=9E=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/module/common/CCEntity.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } /**