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();
 }
Exemplo n.º 3
0
    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);
        }
Exemplo n.º 5
0
 private void SetInitialStatus()
 {
     Display.ShowButtons(RetrieveAssetBundleButton);
     Display.SetInitialStatus(PlayAssetDelivery.IsDownloaded(AssetBundleName));
 }