From fa9025f97a2ee28d340ae1aae50efc1b62deee0b Mon Sep 17 00:00:00 2001 From: donggang <> Date: Thu, 11 Jan 2024 15:24:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20ResLoader=20loadAsync=20?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/common/loader/ResLoader.ts | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/assets/core/common/loader/ResLoader.ts b/assets/core/common/loader/ResLoader.ts index 4d4ca85..8be7850 100644 --- a/assets/core/common/loader/ResLoader.ts +++ b/assets/core/common/loader/ResLoader.ts @@ -118,19 +118,15 @@ oops.res.load("spine_path", sp.SkeletonData, (err: Error | null, sd: sp.Skeleton this.loadByArgs(args); } - loadAsync(bundleName: string, paths: string | string[], type: AssetType | null, onProgress: ProgressCallback | null, onComplete: CompleteCallback | null): void; - loadAsync(bundleName: string, paths: string | string[], onProgress: ProgressCallback | null, onComplete: CompleteCallback | null): void; - loadAsync(bundleName: string, paths: string | string[], onComplete?: CompleteCallback | null): void; - loadAsync(bundleName: string, paths: string | string[], type: AssetType | null, onComplete?: CompleteCallback | null): void; - loadAsync(paths: string | string[], type: AssetType | null, onProgress: ProgressCallback | null, onComplete: CompleteCallback | null): void; - loadAsync(paths: string | string[], onProgress: ProgressCallback | null, onComplete: CompleteCallback | null): void; - loadAsync(paths: string | string[], onComplete?: CompleteCallback | null): void; - loadAsync(paths: string | string[], type: AssetType | null, onComplete?: CompleteCallback | null): void; - loadAsync( - bundleName: string, - paths?: string | string[] | AssetType | ProgressCallback | CompleteCallback | null, - type?: AssetType | ProgressCallback | CompleteCallback | null, - ) { + loadAsync(bundleName: string, paths: string | string[], type: AssetType | null, onProgress: ProgressCallback | null, onComplete: CompleteCallback | null): Promise; + loadAsync(bundleName: string, paths: string | string[], onProgress: ProgressCallback | null, onComplete: CompleteCallback | null): Promise; + loadAsync(bundleName: string, paths: string | string[], onComplete?: CompleteCallback | null): Promise; + loadAsync(bundleName: string, paths: string | string[], type: AssetType | null, onComplete?: CompleteCallback | null): Promise; + loadAsync(paths: string | string[], type: AssetType | null, onProgress: ProgressCallback | null, onComplete: CompleteCallback | null): Promise; + loadAsync(paths: string | string[], onProgress: ProgressCallback | null, onComplete: CompleteCallback | null): Promise; + loadAsync(paths: string | string[], onComplete?: CompleteCallback | null): Promise; + loadAsync(paths: string | string[], type: AssetType | null, onComplete?: CompleteCallback | null): Promise; + loadAsync(bundleName: string, paths?: string | string[] | AssetType | ProgressCallback | CompleteCallback | null, type?: AssetType | ProgressCallback | CompleteCallback | null): Promise { return new Promise((resolve, reject) => { this.load(bundleName, paths, type, (err: Error | null, asset: Asset) => { if (err) {