# Google.Play.AssetDelivery.PlayAssetBundleRequest

**This is an abstract class.**   

A [CustomYieldInstruction](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction.html) used to monitor the asynchronous retrieval of an asset pack containing an AssetBundle.

## Summary

### Inheritance

Inherits from: CustomYieldInstruction

| ### Properties ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8f3e3af963811cd44a6a48eb2cbce581` | `AssetBundle` The AssetBundle loaded by this request. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a66737d20d9b3c3bd0fffe2f191714950` | `float` Progress between 0 and 1 indicating the overall download progress of this request. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1ac403acd13db98ed1aed5efe10013eedb` | `https://developer.android.com/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a84566dc4da8247c6613f8bfb2d2c1736` The error that prevented this requested from completing successfully. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#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. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1adcdb05d8cb2628bdde3e361068a7f827` | `https://developer.android.com/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. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#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. |

| ### Events ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8b5f99f06c389fcf8b8887051f6cecfc = delegate { }` | `Action< https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest >` Event indicating that the request is completed. |

| ### Public functions ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#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. |

| ### Protected functions ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a0cc1aa20b8f1a8a716506ef73ee3dacf()` | `void` Invokes the [Completed](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8b5f99f06c389fcf8b8887051f6cecfc) event. |

## Properties

### AssetBundle

```c#
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

```c#
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

```c#
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

```c#
bool IsDone
```
Returns true if this request is in the AssetDeliveryStatus.Loaded or AssetDeliveryStatus.Failed status, false otherwise.

### Status

```c#
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

```c#
override bool keepWaiting
```
Implements the [CustomYieldInstruction.keepWaiting](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction-keepWaiting.html) property so that this request can be yielded on in a coroutine.

## Events

### Completed

```c#
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

```c#
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

```c#
void InvokeCompletedEvent()
```
Invokes the [Completed](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest_1a8b5f99f06c389fcf8b8887051f6cecfc) event.