(
resourceNames: Array<string>,
onProgress: (loadingCount: integer, totalCount: integer) => void
)
| 304 | } |
| 305 | |
| 306 | async loadResources( |
| 307 | resourceNames: Array<string>, |
| 308 | onProgress: (loadingCount: integer, totalCount: integer) => void |
| 309 | ): Promise<void> { |
| 310 | let loadedCount = 0; |
| 311 | await ResourceLoader.processAndRetryIfNeededWithPromisePool( |
| 312 | resourceNames, |
| 313 | ResourceLoader.maxForegroundConcurrency, |
| 314 | ResourceLoader.maxAttempt, |
| 315 | async (resourceName) => { |
| 316 | const resource = |
| 317 | this.privateResourceManager._resources.get(resourceName); |
| 318 | if (resource) { |
| 319 | await this.privateResourceManager._loadResource(resource); |
| 320 | await this.privateResourceManager._processResource(resource); |
| 321 | } |
| 322 | loadedCount++; |
| 323 | onProgress(loadedCount, this.privateResourceManager._resources.size); |
| 324 | } |
| 325 | ); |
| 326 | } |
| 327 | |
| 328 | /** |
| 329 | * Load the resources that are needed to launch the first scene. |
no test coverage detected