Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Downloader

The downloader pipe in {{loader}}, it can download several types of files:

  1. Text
  2. Image
  3. Script
  4. Audio
  5. Binary All unknown type will be downloaded as plain text. You can pass custom supported types in the {{loader.addDownloadHandlers}}.

Hierarchy

  • Downloader

Implements

Index

Constructors

constructor

Properties

Private _curConcurrent

_curConcurrent: number = 0

Private _loadQueue

_loadQueue: Array<IDownloadItem> = []

Private subPackages

subPackages: {}

Type declaration

async

async: boolean = true

Private extMap

extMap: object

id

id: string = ID

pipeline

pipeline: Pipeline | null = null

Static ID

ID: string = ID

Static PackDownloader

PackDownloader: "E:/workCode/editor-3d-1.2/resources/3d/engine/cocos/core/load-pipeline/pack-downloader" = PackDownloader

Methods

handleLoadQueue

  • _handleLoadQueue(): void

addHandlers

  • addHandlers(extMap: Map<string, Function>): void
  • Add custom supported types handler or modify existing type handler.

    Parameters

    • extMap: Map<string, Function>

      Custom supported types with corresponded handler

    Returns void

handle

  • handle(item: any, callback: any): undefined

loadSubpackage

  • loadSubpackage(name: string, completeCallback?: Function): void
  • Load sub package with name.

    Parameters

    • name: string

      Sub package name

    • Optional completeCallback: Function

      Callback invoked when sub package loaded

    Returns void

setSubPackages

  • setSubPackages(subPackages: any): void

Generated using TypeDoc