void OnItemInGrid(PremiumCurrencyBundle item, GameObject obj) { PremiumBundle creditBundle = obj.GetComponent <PremiumBundle>(); creditBundle.Amount = item.CreditAmount.ToString(); creditBundle.Cost = item.Cost.ToString(); if (item.Data.Count > 0) { creditBundle.ProductID = item.Data[0].Value; } //if (item.CreditPlatformIDs.ContainsKey("IOS_Product_ID")) // creditBundle.ProductID = item.CreditPlatformIDs["IOS_Product_ID"].ToString(); creditBundle.BundleID = item.ID.ToString(); creditBundle.PremiumCurrencyName = ""; creditBundle.Description = item.Description; if (!string.IsNullOrEmpty(item.Image)) { ItemTextureCache.GetItemTexture(item.Image, delegate(Texture2D texture) { creditBundle.SetIcon(texture); }); } creditBundle.SetBundleName(item.Name); creditBundle.OnPurchaseRequest = OnPurchaseRequest; }
public void Purchase(PremiumBundle bundleItem, int amount, string appID) { Debug.Log("Purchase"); string data = "'{\"id\":\"" + bundleItem.BundleID + "\",\"amount\":\"" + amount + "\",\"type\":\"Premium\",\"appID\":\"" + CloudGoodsSettings.AppID + "\"}'"; Application.ExternalEval("KongregatePurchase(" + data + ");"); }
void OnPurchaseRequest(PremiumBundle item) { if (!isPurchaseRequest) { isPurchaseRequest = true; platformPurchasor.Purchase(item, 1, AccountServices.ActiveUser.UserID.ToString()); } }
public void Purchase(PremiumBundle bundleItem, int amount, string userID) { #if UNITY_WEBPLAYER if (Type.GetType("FacebookPurchasing") != null) { FacebookPurchasing = this.gameObject.AddComponent<FacebookPurchasing>() as IFacebookPurchase; } #endif if (FacebookPurchasing == null) { Debug.LogError("Facebook purchase not found. Please add the FacebookPurchase script from the CloudGoodsFacebookAddon folder to this object and drag it as the public reference to the facebookPurchase variable in the inspector"); return; } currentBundleID = int.Parse(bundleItem.BundleID); FacebookPurchasing.Purchase(bundleItem, amount, OnReceivedFacebookCurrencyPurchase); }
public void Purchase(PremiumBundle bundleItem, int amount, string userID) { #if UNITY_ANDROID if (string.IsNullOrEmpty(CloudGoodsSettings.AndroidKey)) { Debug.LogError("No Android key has been set, cannot purchase from premium store"); return; } currentBundleID = int.Parse(bundleItem.BundleID); currentProductID = bundleItem.ProductID; using (AndroidJavaObject obj_Activity = cls.GetStatic <AndroidJavaObject>("currentActivity")) { jc.CallStatic("PurchasePremiumCurrencyBundle", obj_Activity, currentProductID); } #endif }
public void Purchase(PremiumBundle bundleItem, int amount, string userID) { #if UNITY_WEBPLAYER if (Type.GetType("FacebookPurchasing") != null) { FacebookPurchasing = this.gameObject.AddComponent <FacebookPurchasing>() as IFacebookPurchase; } #endif if (FacebookPurchasing == null) { Debug.LogError("Facebook purchase not found. Please add the FacebookPurchase script from the CloudGoodsFacebookAddon folder to this object and drag it as the public reference to the facebookPurchase variable in the inspector"); return; } currentBundleID = int.Parse(bundleItem.BundleID); FacebookPurchasing.Purchase(bundleItem, amount, OnReceivedFacebookCurrencyPurchase); }
public void Purchase(PremiumBundle bundleItem, int amount, string userID) { #if UNITY_ANDROID if (string.IsNullOrEmpty(CloudGoodsSettings.AndroidKey)) { Debug.LogError("No Android key has been set, cannot purchase from premium store"); return; } currentBundleID = int.Parse(bundleItem.BundleID); currentProductID = bundleItem.ProductID; using (AndroidJavaObject obj_Activity = cls.GetStatic<AndroidJavaObject>("currentActivity")) { jc.CallStatic("PurchasePremiumCurrencyBundle", obj_Activity, currentProductID); } #endif }
public void Purchase(PremiumBundle bundleItem, int amount, string userID) { Debug.Log("Purchase ios called"); currentBundleID = int.Parse(bundleItem.BundleID); iOSConnect.RequestInAppPurchase(bundleItem.ProductID); }