Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


coreUnityAssetPacksDownloaded

Checks if all core Unity asset packs are downloaded.
Read time 1 minuteLast updated 8 days ago

Definition

public static bool coreUnityAssetPacksDownloaded { get; }

Remarks

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.