# Google.Play.AssetDelivery.PlayAssetPackRequest

**This is an abstract class.**   

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

## Summary

### Inheritance

Inherits from: CustomYieldInstruction

| ### Properties ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a3bfa18fd751b205241c6e49ede6ed4d1` | `float` Progress between 0 and 1 indicating the overall download progress of this request. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a02af628730f16558ac289bc9da71e5f9` | `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/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a3d45ee60f30dc90fa1b2149761b52473` | `bool` Returns true if this request is in the AssetDeliveryStatus.Available or AssetDeliveryStatus.Failed status, false otherwise. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a2e328a9f63f915cddf649b9a56ee4f12` | `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.Available. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a7f3de72ef5bfd604e1f940f3196d2f0d` | `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/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a581a8f9c1713a7163176f23292273892 = delegate { }` | `Action< https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest >` Event indicating that the request is completed. |

| ### Public functions ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1af41500f47ed9dcd089e61209523d4005()` | `virtual abstract void` Cancels the request if possible, setting Status to AssetDeliveryStatus.Failed and Error to AssetDeliveryErrorCode.Canceled. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1abf75a8c64a3a947b578bffeaee66a78b(string assetPath)` | `virtual abstract https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/AssetLocation#classGoogle_1_1Play_1_1AssetDelivery_1_1AssetLocation` Retrieves the location of an asset at the specified path within this asset pack. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a088d0f57a1e8d755f454c8d67290022a(string assetBundlePath)` | `virtual abstract AssetBundleCreateRequest` Loads the AssetBundle located at the specified path within this asset pack. |

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

## Properties

### 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.Available 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.Available.

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< 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

```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.Available or AssetDeliveryStatus.Failed, then the request is left unchanged.

### GetAssetLocation

```c#
virtual abstract AssetLocation GetAssetLocation(
  string assetPath
)
```
Retrieves the location of an asset at the specified path within this asset pack.

<br />

Details Parameters `assetPath` The path within this asset pack pointing to the desired asset. **Returns** An [AssetLocation](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/AssetLocation#classGoogle_1_1Play_1_1AssetDelivery_1_1AssetLocation) object describing the path, offset and size of a the requested asset file within the asset pack.

### LoadAssetBundleAsync

```c#
virtual abstract AssetBundleCreateRequest LoadAssetBundleAsync(
  string assetBundlePath
)
```
Loads the AssetBundle located at the specified path within this asset pack.

<br />

Details Parameters `assetBundlePath` The path within this asset pack pointing to the desired AssetBundle. **Returns** An [AssetBundleCreateRequest](https://docs.unity3d.com/ScriptReference/AssetBundleCreateRequest.html) that can be yielded on until the AssetBundle is loaded.

## Protected functions

### InvokeCompletedEvent

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