Google.Play.AssetDelivery.PlayAssetPackRequest

This is an abstract class.

An object used to monitor the asynchronous retrieval of an asset pack via the Play Asset Delivery system.

Summary

Inheritance

Inherits from: CustomYieldInstruction

Properties

DownloadProgress
float
Progress between 0.0f and 1.0f indicating the overall download progress of this request.
Error
The error that prevented this requested from completing successfully.
IsDone
bool
Returns true if this request is in the AssetDeliveryStatus.Available or AssetDeliveryStatus.Failed status, false otherwise.
Status
An enum indicating the status of this request (downloading, downloaded, installed etc.) If the request completed successfully, this value should be AssetDeliveryStatus.Available.
keepWaiting
override bool
Implements CustomYieldInstruction's keepWaiting method, so that this request can be yielded on, in a coroutine, until it is done.

Events

Completed = delegate { }
Event indicating that the request is completed.

Public functions

AttemptCancel()
virtual abstract void
Cancels the request if possible, setting Status to AssetDeliveryStatus.Failed and Error to AssetDeliveryErrorCode.Canceled.
GetAssetLocation(string assetPath)
virtual abstract AssetLocation
Retrieves the location of an asset at the specified path within this asset pack.
LoadAssetBundleAsync(string assetBundlePath)
virtual abstract AssetBundleCreateRequest
Loads the AssetBundle located at the specified path within this asset pack.

Protected functions

InvokeCompletedEvent()
void
Invokes the Completed event.

Properties

DownloadProgress

float DownloadProgress

Progress between 0.0f and 1.0f indicating the overall download progress of this request.

Note: If this value is equal to 1.0f, it does not mean that the request has completed, only that the DOWNLOADING stage is finished.

Error

AssetDeliveryErrorCode Error

The error that prevented this requested from completing successfully.

In the case of a successful request, this will always be AssetDeliveryErrorCode.NoError.

IsDone

bool IsDone

Returns true if this request is in the AssetDeliveryStatus.Available or AssetDeliveryStatus.Failed status, false otherwise.

Status

AssetDeliveryStatus Status

An enum indicating the status of this request (downloading, downloaded, installed etc.) If the request completed successfully, this value should be AssetDeliveryStatus.Available.

If an error occured, it should be AssetDeliveryStatus.Failed.

keepWaiting

override bool keepWaiting

Implements CustomYieldInstruction's keepWaiting method, so that this request can be yielded on, in a coroutine, until it is done.

Events

Completed

Action< PlayAssetPackRequest > Completed = delegate { }

Event indicating that the request is completed.

If an event handler is registered after the operation has completed, and thus after this event has been invoked, then the handler will be called synchronously.

Public functions

AttemptCancel

virtual abstract void AttemptCancel()

Cancels the request if possible, setting Status to AssetDeliveryStatus.Failed and Error to AssetDeliveryErrorCode.Canceled.

If the request is already AssetDeliveryStatus.Available or AssetDeliveryStatus.Failed, then the request is left unchanged.

GetAssetLocation

virtual abstract AssetLocation GetAssetLocation(
  string assetPath
)

Retrieves the location of an asset at the specified path within this asset pack.

Details
Parameters
assetPath
The path within this asset pack pointing to the desired asset.
Returns
An AssetLocation object describing the path, offset and size of a the requested asset file within the asset pack.

LoadAssetBundleAsync

virtual abstract AssetBundleCreateRequest LoadAssetBundleAsync(
  string assetBundlePath
)

Loads the AssetBundle located at the specified path within this asset pack.

Details
Parameters
assetBundlePath
The path within this asset pack pointing to the desired AssetBundle.
Returns
An AssetBundleCreateRequest that can be yielded on until the AssetBundle is loaded.

Protected functions

InvokeCompletedEvent

void InvokeCompletedEvent()

Invokes the Completed event.