UnityEditor.AssetStoreContext.Download C# (CSharp) Method

Download() public method

public Download ( Package package, DownloadInfo downloadInfo ) : void
package Package
downloadInfo DownloadInfo
return void
        public void Download(Package package, DownloadInfo downloadInfo)
        {
            Download(downloadInfo.id, downloadInfo.url, downloadInfo.key, package.title, package.publisher.label, package.category.label, null);
        }

Same methods

AssetStoreContext::Download ( string package_id, string url, string key, string package_name, string publisher_name, string category_name, AssetStoreUtils doneCallback ) : void

Usage Example

示例#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();
            });
        }
All Usage Examples Of UnityEditor.AssetStoreContext::Download