diff --git a/assets/module/common/GameComponent.ts b/assets/module/common/GameComponent.ts index a2088dd..ac7845e 100644 --- a/assets/module/common/GameComponent.ts +++ b/assets/module/common/GameComponent.ts @@ -123,19 +123,15 @@ export class GameComponent extends Component { } /** 异步加载资源 */ - 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): Promise; + loadAsync(bundleName: string, paths: string | string[]): Promise; + loadAsync(bundleName: string, paths: string | string[]): Promise; + loadAsync(bundleName: string, paths: string | string[], type: AssetType | null): Promise; + loadAsync(paths: string | string[], type: AssetType | null): Promise; + loadAsync(paths: string | string[]): Promise; + loadAsync(paths: string | string[]): Promise; + loadAsync(paths: string | string[], type: AssetType | null): Promise; + loadAsync(bundleName: string, paths?: string | string[] | AssetType | ProgressCallback | CompleteCallback | null, type?: AssetType | ProgressCallback | CompleteCallback | null): Promise { if (this.resPaths == null) this.resPaths = new Map(); if (paths instanceof Array) {