修改GameComponent.loadAsync与ResLoader..loadAsync的返回值一致

This commit is contained in:
donggang
2024-06-26 18:37:42 +08:00
parent fafe542e70
commit 08a549bcc0

View File

@@ -123,19 +123,15 @@ export class GameComponent extends Component {
}
/** 异步加载资源 */
loadAsync<T extends Asset>(bundleName: string, paths: string | string[], type: AssetType<T> | null, onProgress: ProgressCallback | null, onComplete: CompleteCallback<T> | null): void;
loadAsync<T extends Asset>(bundleName: string, paths: string | string[], onProgress: ProgressCallback | null, onComplete: CompleteCallback<T> | null): void;
loadAsync<T extends Asset>(bundleName: string, paths: string | string[], onComplete?: CompleteCallback<T> | null): void;
loadAsync<T extends Asset>(bundleName: string, paths: string | string[], type: AssetType<T> | null, onComplete?: CompleteCallback<T> | null): void;
loadAsync<T extends Asset>(paths: string | string[], type: AssetType<T> | null, onProgress: ProgressCallback | null, onComplete: CompleteCallback<T> | null): void;
loadAsync<T extends Asset>(paths: string | string[], onProgress: ProgressCallback | null, onComplete: CompleteCallback<T> | null): void;
loadAsync<T extends Asset>(paths: string | string[], onComplete?: CompleteCallback<T> | null): void;
loadAsync<T extends Asset>(paths: string | string[], type: AssetType<T> | null, onComplete?: CompleteCallback<T> | null): void;
loadAsync<T extends Asset>(
bundleName: string,
paths?: string | string[] | AssetType<T> | ProgressCallback | CompleteCallback | null,
type?: AssetType<T> | ProgressCallback | CompleteCallback | null,
) {
loadAsync<T extends Asset>(bundleName: string, paths: string | string[], type: AssetType<T> | null): Promise<T>;
loadAsync<T extends Asset>(bundleName: string, paths: string | string[]): Promise<T>;
loadAsync<T extends Asset>(bundleName: string, paths: string | string[]): Promise<T>;
loadAsync<T extends Asset>(bundleName: string, paths: string | string[], type: AssetType<T> | null): Promise<T>;
loadAsync<T extends Asset>(paths: string | string[], type: AssetType<T> | null): Promise<T>;
loadAsync<T extends Asset>(paths: string | string[]): Promise<T>;
loadAsync<T extends Asset>(paths: string | string[]): Promise<T>;
loadAsync<T extends Asset>(paths: string | string[], type: AssetType<T> | null): Promise<T>;
loadAsync<T extends Asset>(bundleName: string, paths?: string | string[] | AssetType<T> | ProgressCallback | CompleteCallback | null, type?: AssetType<T> | ProgressCallback | CompleteCallback | null): Promise<T> {
if (this.resPaths == null) this.resPaths = new Map();
if (paths instanceof Array) {