Stay organized with collections
Save and categorize content based on your preferences.
Google.Play.AssetDelivery.PlayAssetBundleRequest
This is an abstract class.A CustomYieldInstruction used to monitor the asynchronous retrieval of an asset pack containing an AssetBundle.
Summary
Inheritance
Inherits from: CustomYieldInstruction
Properties
|
AssetBundle
|
AssetBundle
The AssetBundle loaded by this request.
|
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.Loaded 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.Loaded.
|
keepWaiting
|
override bool
|
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.
|
Properties
AssetBundle
AssetBundle AssetBundle
The AssetBundle loaded by this request.
This corresponds to the AssetBundle name passed into this request. If Status is not AssetDeliveryStatus.Loaded, this value is null.
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.Loaded 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.Loaded.
If an error occured, it should be AssetDeliveryStatus.Failed.
keepWaiting
override bool keepWaiting
Events
Completed
Action< PlayAssetBundleRequest > 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.Loading, AssetDeliveryStatus.Loaded or AssetDeliveryStatus.Failed, then the request is left unchanged.
Protected functions
InvokeCompletedEvent
void InvokeCompletedEvent()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-03-29 UTC.
[null,null,["Last updated 2021-03-29 UTC."],[],[],null,["# Google.Play.AssetDelivery.PlayAssetBundleRequest Class Reference\n\nGoogle.Play.AssetDelivery.PlayAssetBundleRequest\n================================================\n\n**This is an abstract class.** \n\nA [CustomYieldInstruction](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction.html) used to monitor the asynchronous retrieval of an asset pack containing an AssetBundle.\n\nSummary\n-------\n\n### Inheritance\n\nInherits from: CustomYieldInstruction\n\n| ### Properties ||\n|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [AssetBundle](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8f3e3af963811cd44a6a48eb2cbce581) | `AssetBundle` The AssetBundle loaded by this request. |\n| [DownloadProgress](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a66737d20d9b3c3bd0fffe2f191714950) | `float` Progress between 0 and 1 indicating the overall download progress of this request. |\n| [Error](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1ac403acd13db98ed1aed5efe10013eedb) | [AssetDeliveryErrorCode](/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a84566dc4da8247c6613f8bfb2d2c1736) The error that prevented this requested from completing successfully. |\n| [IsDone](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8088a6607060a67ce13273f237f2f4d9) | `bool` Returns true if this request is in the AssetDeliveryStatus.Loaded or AssetDeliveryStatus.Failed status, false otherwise. |\n| [Status](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1adcdb05d8cb2628bdde3e361068a7f827) | [AssetDeliveryStatus](/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a6e923e75b34c3ebb387ca321c34675ce) An enum indicating the status of this request (downloading, downloaded, installed etc.) If the request completed successfully, this value should be AssetDeliveryStatus.Loaded. |\n| [keepWaiting](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1aaa8b488315dbd94ad091416312b214cd) | `override bool` Implements the [CustomYieldInstruction.keepWaiting](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction-keepWaiting.html) property so that this request can be yielded on in a coroutine. |\n\n| ### Events ||\n|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Completed](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8b5f99f06c389fcf8b8887051f6cecfc)` = delegate { }` | `Action\u003c `[PlayAssetBundleRequest](/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest)` \u003e` Event indicating that the request is completed. |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [AttemptCancel](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a352bfe7cdff7d41c9039b1b54f1f61ad)`()` | `virtual abstract void` Cancels the request if possible, setting Status to AssetDeliveryStatus.Failed and Error to AssetDeliveryErrorCode.Canceled. |\n\n| ### Protected functions ||\n|--------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [InvokeCompletedEvent](#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a0cc1aa20b8f1a8a716506ef73ee3dacf)`()` | `void` Invokes the [Completed](/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8b5f99f06c389fcf8b8887051f6cecfc) event. |\n\nProperties\n----------\n\n### AssetBundle\n\n```c#\nAssetBundle AssetBundle\n``` \nThe AssetBundle loaded by this request.\n\nThis corresponds to the AssetBundle name passed into this request. If Status is not AssetDeliveryStatus.Loaded, this value is null. \n\n### DownloadProgress\n\n```c#\nfloat DownloadProgress\n``` \nProgress between 0 and 1 indicating the overall download progress of this request.\n\nNote: If this value is equal to 1, it does not mean that the request has completed, only that the Downloading stage is finished. \n\n### Error\n\n```c#\nAssetDeliveryErrorCode Error\n``` \nThe error that prevented this requested from completing successfully.\n\nIn the case of a successful request, this will always be AssetDeliveryErrorCode.NoError. \n\n### IsDone\n\n```c#\nbool IsDone\n``` \nReturns true if this request is in the AssetDeliveryStatus.Loaded or AssetDeliveryStatus.Failed status, false otherwise. \n\n### Status\n\n```c#\nAssetDeliveryStatus Status\n``` \nAn enum indicating the status of this request (downloading, downloaded, installed etc.) If the request completed successfully, this value should be AssetDeliveryStatus.Loaded.\n\nIf an error occured, it should be AssetDeliveryStatus.Failed. \n\n### keepWaiting\n\n```c#\noverride bool keepWaiting\n``` \nImplements the [CustomYieldInstruction.keepWaiting](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction-keepWaiting.html) property so that this request can be yielded on in a coroutine.\n\nEvents\n------\n\n### Completed\n\n```c#\nAction\u003c PlayAssetBundleRequest \u003e Completed = delegate { }\n``` \nEvent indicating that the request is completed.\n\nIf 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.\n\nPublic functions\n----------------\n\n### AttemptCancel\n\n```c#\nvirtual abstract void AttemptCancel()\n``` \nCancels the request if possible, setting Status to AssetDeliveryStatus.Failed and Error to AssetDeliveryErrorCode.Canceled.\n\nIf the request is already AssetDeliveryStatus.Loading, AssetDeliveryStatus.Loaded or AssetDeliveryStatus.Failed, then the request is left unchanged.\n\nProtected functions\n-------------------\n\n### InvokeCompletedEvent\n\n```c#\nvoid InvokeCompletedEvent()\n``` \nInvokes the [Completed](/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8b5f99f06c389fcf8b8887051f6cecfc) event."]]