/// <summary> /// Downloads all availiable (uninstalled) DLC asset files /// </summary> /// <param name="checkEntitlement">True to check if the player owns the asset file or is free prior to downloading</param> private void DownloadAllAvailable(bool checkEntitlement) { foreach (AssetDetails ad in assetList) { if (checkEntitlement && ad.IapStatus == "not-entitled") { continue; } if (ad.DownloadStatus != "installed" && ad.DownloadStatus != "in-progress") { AssetFile.DownloadById(ad.AssetId).OnComplete(DownloadAssetFileCallback); } } }
private void LaunchCheckoutFlowCallback(Message <Purchase> msg) { if (msg.IsError) { Debug.LogError(msg.GetError().Message, this); return; } Purchase p = msg.GetPurchase(); Debug.Log("Purchased " + p.Sku); // Download the asset file from Oculus AssetFile.DownloadById(p.ID).OnComplete(DownloadAssetFileCallback); }