public DownloadSizeAsyncOperation(IList <string> assetPacks) { assetPackSizeOperations = new List <PlayAsyncOperation <long, AssetDeliveryErrorCode> >(); foreach (string assetPack in assetPacks) { // check if the asset pack was already downloaded either during install or previous launch. if (PlayAssetDelivery.IsDownloaded(assetPack)) { Debug.LogFormat("[{0}] Assetpack={1} Already downloaded", nameof(DownloadSizeAsyncOperation), assetPack); continue; } PlayAsyncOperation <long, AssetDeliveryErrorCode> sizeOperation = PlayAssetDelivery.GetDownloadSize(assetPack); assetPackSizeOperations.Add(sizeOperation); if (sizeOperation.IsDone) { OnGetPackDownloadSize(sizeOperation); continue; } sizeOperation.Completed += OnGetPackDownloadSize; } // No Asset packs needed to be updated. if (assetPackSizeOperations.Count == 0) { Complete(AsyncOperationStatus.Succeeded); } }
private void SetInitialStatus() { ColorTint.color = NeutralColor; LoadingBar.SetProgress(0f); ShowButtons(RetrieveAssetBundleButton); StatusText.text = PlayAssetDelivery.IsDownloaded(AssetBundleName) ? AssetDeliveryStatus.Available.ToString() : AssetDeliveryStatus.Pending.ToString(); }
public bool IsDownloaded() { bool isDownloaded; if (isSingleAssetBundlePack && assetBundleRequest != null) { isDownloaded = assetBundleRequest.IsDone; } else { isDownloaded = PlayAssetDelivery.IsDownloaded(assetPackName); } return(isDownloaded); }
private void SetInitialStatus() { Display.ShowButtons(RetrieveAssetPackBatchButton); var allDownloaded = true; foreach (var asset in Assets) { if (!PlayAssetDelivery.IsDownloaded(asset.AssetPackName)) { allDownloaded = false; break; } } Display.SetInitialStatus(allDownloaded); }
private void SetInitialStatus() { Display.ShowButtons(RetrieveAssetBundleButton); Display.SetInitialStatus(PlayAssetDelivery.IsDownloaded(AssetBundleName)); }