Android 打包AAB+PAD(Unity篇),Android开发基础面试题

这些部分适用于**「fast-follow」「on-demand」**资产包。

检查状态


每个资产包都存储在应用程序内部存储的单独文件夹中。使用该 「isDownloaded()」 方法确定是否已下载资产包。

监控下载


查询PlayAssetBundleRequest 监控请求状态的 对象:

// Download progress of request, between 0.0f and 1.0f. The value will always be

// 1.0 for assets delivered as install-time.

// NOTE: A value of 1.0 will only signify the download is complete. It will still need to be loaded.

float progress = bundleRequest.DownloadProgress;

// Returns true if:

//   * it had either completed the download, installing, and loading of the AssetBundle,

//   * OR if it has encountered an error.

bool done = bundleRequest.IsDone;

// Returns status of retrieval request.

AssetDeliveryStatus status = bundleRequest.Status;

switch(status) {

case AssetDeliveryStatus.Pending:

// Asset pack download is pending - N/A for install-time assets.

case AssetDeliveryStatus.Retrieving:

// Asset pack is being downloaded and transferred to app storage.

// N/A for install-time assets.

case AssetDeliveryStatus.Available:

// Asset pack is downloaded on disk but NOT loaded into memory.

// For PlayAssetPackRequest(), this indicates that the request is complete.

case AssetDeliveryStatus.Loading:

// Asset pack is being loaded.

case AssetDeliveryStatus.Loaded:

// Asset pack has finished loading, assets can now be loaded.

// For PlayAssetBundleRequest(), this indicates that the request is complete.

case AssetDeliveryStatus.Failed:

// Asset pack retrieval has failed.

case AssetDeliveryStatus.WaitingForWifi:

// Asset pack retrieval paused until either the device connects via Wi-Fi,

// or the user accepts the PlayAssetDelivery.ShowCellularDataConfirmation dialog.

default:

break;

}

大量下载

  • 11
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值