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(); }); }
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(); } } }); }
public bool OpenPackage(string id, string action) { return(AssetStoreContext.OpenPackageInternal(id)); }