Download() public method

public Download ( Package package, DownloadInfo downloadInfo ) : void
package Package
downloadInfo DownloadInfo
return void
示例#1
0
        void DownloadPackage()
        {
            AssetStoreAsset.PreviewInfo item = m_Asset.previewInfo;
            m_Purchasing          = PurchaseStatus.Downloading;
            item.downloadProgress = 0;
            item.buildProgress    = -1f;

            AssetStoreContext.Download(m_Asset.packageID.ToString(), item.packageUrl, item.encryptionKey, item.packageName,
                                       item.publisherName, item.categoryName, delegate(string id, string status, int bytes, int total) {
                if (this == null)
                {
                    return;                   // aborted
                }
                item.downloadProgress = -1f;
                if (status != "ok")
                {
                    Debug.LogErrorFormat("Error downloading package {0} ({1})", item.packageName, id);
                    Debug.LogError(status);
                    Close();
                    return;
                }

                if (m_Asset == null || m_Purchasing != PurchaseStatus.Downloading || id != m_Asset.packageID.ToString())
                {
                    // Aborted
                    Close();
                }

                if (!AssetStoreContext.OpenPackageInternal(id))
                {
                    Debug.LogErrorFormat("Error importing package {0} ({1})", item.packageName, id);
                }
                Close();
            });
        }
示例#2
0
 private void DownloadPackage()
 {
     AssetStoreAsset.PreviewInfo item = this.m_Asset.previewInfo;
     this.m_Purchasing     = AssetStoreInstaBuyWindow.PurchaseStatus.Downloading;
     item.downloadProgress = 0f;
     item.buildProgress    = -1f;
     AssetStoreContext.Download(this.m_Asset.packageID.ToString(), item.packageUrl, item.encryptionKey, item.packageName, item.publisherName, item.categoryName, delegate(string id, string status, int bytes, int total)
     {
         if (!(this == null))
         {
             item.downloadProgress = -1f;
             if (status != "ok")
             {
                 Debug.LogErrorFormat("Error downloading package {0} ({1})", new object[]
                 {
                     item.packageName,
                     id
                 });
                 Debug.LogError(status);
                 this.Close();
             }
             else
             {
                 if (this.m_Asset == null || this.m_Purchasing != AssetStoreInstaBuyWindow.PurchaseStatus.Downloading || id != this.m_Asset.packageID.ToString())
                 {
                     this.Close();
                 }
                 if (!AssetStoreContext.OpenPackageInternal(id))
                 {
                     Debug.LogErrorFormat("Error importing package {0} ({1})", new object[]
                     {
                         item.packageName,
                         id
                     });
                 }
                 this.Close();
             }
         }
     });
 }
 private void DownloadPackage()
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     AssetStoreInstaBuyWindow.\u003CDownloadPackage\u003Ec__AnonStorey58 packageCAnonStorey58 = new AssetStoreInstaBuyWindow.\u003CDownloadPackage\u003Ec__AnonStorey58();
     // ISSUE: reference to a compiler-generated field
     packageCAnonStorey58.\u003C\u003Ef__this = this;
     // ISSUE: reference to a compiler-generated field
     packageCAnonStorey58.item = this.m_Asset.previewInfo;
     this.m_Purchasing         = AssetStoreInstaBuyWindow.PurchaseStatus.Downloading;
     // ISSUE: reference to a compiler-generated field
     packageCAnonStorey58.item.downloadProgress = 0.0f;
     // ISSUE: reference to a compiler-generated field
     packageCAnonStorey58.item.buildProgress = -1f;
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated field
     // ISSUE: reference to a compiler-generated method
     AssetStoreContext.Download(this.m_Asset.packageID.ToString(), packageCAnonStorey58.item.packageUrl, packageCAnonStorey58.item.encryptionKey, packageCAnonStorey58.item.packageName, packageCAnonStorey58.item.publisherName, packageCAnonStorey58.item.categoryName, new AssetStoreUtils.DownloadDoneCallback(packageCAnonStorey58.\u003C\u003Em__98));
 }
 public void Download(AssetStoreContext.Package package, AssetStoreContext.DownloadInfo downloadInfo)
 {
     AssetStoreContext.Download(downloadInfo.id, downloadInfo.url, downloadInfo.key, package.title, package.publisher.label, package.category.label, null);
 }