DownloadAssetPackAsync
Downloads Android asset packs.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Android
- Assembly: UnityEngine.AndroidJNIModule
DownloadAssetPackAsync(string[], Action<AndroidAssetPackInfo>)
Downloads Android asset packs.
public static void DownloadAssetPackAsync(string[] assetPackNames, Action<AndroidAssetPackInfo> callback)
Parameters
The array of names of Android asset packs to download.
The callback method to inform about download progress. It gets called multiple times for each asset pack during its download. The callback method must have a parameter of AndroidAssetPackInfo type. The default value is null.
Remarks
This method directly wraps Google's PlayCore plug-in API. If the PlayCore plug-in is missing, calling this method throws an .
InvalidOperationExceptionAdditional Resources: AndroidAssetPackInfo, AndroidAssetPacks.CancelAssetPackDownload, AndroidAssetPacks.GetAssetPackPath, AndroidAssetPacks.GetAssetPackStateAsync, AndroidAssetPacks.RemoveAssetPack, AndroidAssetPacks.RequestToUseMobileDataAsync.
DownloadAssetPackAsync(string[])
Downloads Android asset packs to the device.
public static DownloadAssetPackAsyncOperation DownloadAssetPackAsync(string[] assetPackNames)
Parameters
The array of names of Android asset packs to download.
Returns
Type | Description |
|---|---|
| DownloadAssetPackAsyncOperation | An object that represents the download operation. If you yield this object inside a coroutine, the coroutine pauses until the operation is complete. |
Remarks
This method directly wraps Google's PlayCore plug-in API. If the PlayCore plug-in is missing, calling this method throws an .
InvalidOperationException