Version: 2022.2
LanguageEnglish
  • C#

AndroidAssetPacks.DownloadAssetPackAsync

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static Android.DownloadAssetPackAsyncOperation DownloadAssetPackAsync(string[] assetPackNames);

Parameters

assetPackNames The array of names of Android asset packs to download.

Returns

DownloadAssetPackAsyncOperation Returns an object that represents the download operation. If you yield this object inside a coroutine, the coroutine pauses until the operation is complete.

Description

Downloads Android asset packs.

This method directly wraps Google's PlayCore plugin API. If the PlayCore plugin is missing, calling this method throws an InvalidOperationException exception. See Also: DownloadAssetPackAsyncOperation, AndroidAssetPackInfo, AndroidAssetPacks.CancelAssetPackDownload, AndroidAssetPacks.GetAssetPackPath, AndroidAssetPacks.GetAssetPackStateAsync, AndroidAssetPacks.RemoveAssetPack, AndroidAssetPacks.RequestToUseMobileDataAsync.


Declaration

public static void DownloadAssetPackAsync(string[] assetPackNames, Action<AndroidAssetPackInfo> callback);

Parameters

assetPackNames The array of names of Android asset packs to download.
callback 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.

Description

Downloads Android asset packs.

This method directly wraps Google's PlayCore plugin API. If the PlayCore plugin is missing, calling this method throws an InvalidOperationException exception. See Also: AndroidAssetPackInfo, AndroidAssetPacks.CancelAssetPackDownload, AndroidAssetPacks.GetAssetPackPath, AndroidAssetPacks.GetAssetPackStateAsync, AndroidAssetPacks.RemoveAssetPack, AndroidAssetPacks.RequestToUseMobileDataAsync.