From de8b0c563d30400f27e9f098def8b1eb548b1b24 Mon Sep 17 00:00:00 2001 From: dgflash Date: Thu, 25 Jul 2024 17:15:41 +0800 Subject: [PATCH] =?UTF-8?q?GameComponent.createPrefabNodeAsync=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=8A=A0=E8=BD=BD=E8=87=AA=E5=AE=9A=E4=B9=89=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=8C=85=E4=B8=AD=E7=9A=84=E9=A2=84=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/module/common/GameComponent.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/module/common/GameComponent.ts b/assets/module/common/GameComponent.ts index fd4882c..2b34f9d 100644 --- a/assets/module/common/GameComponent.ts +++ b/assets/module/common/GameComponent.ts @@ -101,11 +101,12 @@ export class GameComponent extends Component { /** * 加载预制并创建预制节点 - * @param path 资源路径 + * @param path 资源路径 + * @param bundleName 资源包名 */ - createPrefabNodeAsync(path: string): Promise { + createPrefabNodeAsync(path: string, bundleName: string = oops.res.defaultBundleName): Promise { return new Promise((resolve, reject) => { - this.load(path, Prefab, (err: Error | null, content: Prefab) => { + this.load(bundleName, path, Prefab, (err: Error | null, content: Prefab) => { if (err) { console.error(`名为【${path}】的资源加载失败`); resolve(null!);