Pipeline.Downloader 类型

模块: cc

The downloader pipe, it can download several types of files:

  1. Text
  2. Image
  3. Script
  4. Audio
  5. Assets All unknown type will be downloaded as plain text. You can pass custom supported types in the constructor.

索引

方法
  • constructor Constructor of Downloader, you can pass custom supported types.
  • addHandlers Add custom supported types handler or modify existing type handler.
  • loadSubpackage 通过子包名加载子包代码。

Details

方法

constructor

Constructor of Downloader, you can pass custom supported types.

meta description
定义于 cocos2d/core/load-pipeline/downloader.js:211
参数列表
  • extMap Object Custom supported types with corresponded handler
示例
var downloader = new Downloader({
     // This will match all url with `.scene` extension or all url with `scene` type
     'scene' : function (url, callback) {}
 });
addHandlers

Add custom supported types handler or modify existing type handler.

meta description
定义于 cocos2d/core/load-pipeline/downloader.js:236
参数列表
  • extMap Object Custom supported types with corresponded handler
loadSubpackage

通过子包名加载子包代码。

meta description
定义于 cocos2d/core/load-pipeline/downloader.js:294
参数列表
  • name String Subpackage name
  • completeCallback Function Callback invoked when subpackage loaded
    • error Error error information

条与 "" 相匹配的结果

    没有与 "" 匹配的结果