Google. Play. AssetDelivery. PlayAssetPackRequest
This is an abstract class.A CustomYieldInstruction used to monitor the asynchronous retrieval of an asset pack.
Summary
Inheritance
Inherits from: CustomYieldInstruction
Properties |
|
---|---|
DownloadProgress
|
float
Progress between 0 and 1 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 the CustomYieldInstruction.keepWaiting property so that this request can be yielded on in a coroutine.
|
Events |
|
---|---|
Completed = delegate { }
|
Action< PlayAssetPackRequest >
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 and 1 indicating the overall download progress of this request.
Note: If this value is equal to 1, 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 the CustomYieldInstruction.keepWaiting property so that this request can be yielded on in a coroutine.
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 |
|
||
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 |
|
||
Returns |
An AssetBundleCreateRequest that can be yielded on until the AssetBundle is loaded.
|