Version: Unity 6.0 (6000.0)
LanguageEnglish
  • C#

AndroidAssetPacks.coreUnityAssetPacksDownloaded

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

public static bool coreUnityAssetPacksDownloaded;

Description

Checks if all core Unity asset packs are downloaded.

Read-only. Returns true if all core Unity asset packs are downloaded. Otherwise, returns false if any core Unity asset packs aren't downloaded or if the PlayCore plug-in is missing.

Core Unity asset packs are asset packs that Unity creates automatically when it builds the Android app bundle. Unity only creates core asset packs if you enable Split Application Binary in Android Player settings or if you use Texture Compression Targeting. To safely access assets in the streaming assets path, resources directory, or to safely load any scenes other than the first, only access them after this property returns true.

When the property returns false, check the download status of the core Unity asset packs. To do this, call AndroidAssetPacks.GetCoreUnityAssetPackNames to get the array of core Unity asset pack names, then call AndroidAssetPacks.GetAssetPackStateAsync and pass in the names array. If the state indicates that the device hasn't yet downloaded an asset pack, or the device is not downloading an asset pack, call AndroidAssetPacks.DownloadAssetPackAsync passing in the asset pack's name. If there are asset packs that have the WaitingForWifi status, ask the user to allow the application to download them using mobile data. To do this, call AndroidAssetPacks.RequestToUseMobileDataAsync.

If this property returns false and GetCoreUnityAssetPackNames returns an empty array, then the application doesn't have the PlayCore plugin. Unity automatically adds it as a dependency in unityLibrary's build.gradle file when it builds the Android application with asset packs.