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();
});
}