public IapManager.BundleItem[] GetProductRewardsAsBundleItems(IapManager.InAppPurchaseItemType itemType) { Hashtable productRewards = this.GetProductRewards(itemType); List <IapManager.BundleItem> list = new List <IapManager.BundleItem>(); IDictionaryEnumerator enumerator = productRewards.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; DictionaryEntry dictionaryEntry = (DictionaryEntry)obj; if (Enum.IsDefined(typeof(IapManager.BundleItem.BundleItemType), (string)dictionaryEntry.Key)) { IapManager.BundleItem.BundleItemType type = (IapManager.BundleItem.BundleItemType)Enum.Parse(typeof(IapManager.BundleItem.BundleItemType), (string)dictionaryEntry.Key); int count = int.Parse((string)dictionaryEntry.Value); list.Add(new IapManager.BundleItem(type, count)); } } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } return(list.ToArray()); }
private float GetPrice(IapManager.InAppPurchaseItemType item) { if (!Singleton <IapManager> .IsInstantiated() || !Singleton <IapManager> .Instance.ReadyForTransaction) { return(0f); } string prodId = Singleton <IapManager> .Instance.GetProductIdByItem(item); if (!string.IsNullOrEmpty(prodId)) { IAPProductInfo iapproductInfo = null; foreach (IAPProductInfo x in Singleton <IapManager> .Instance.ProductList) { if (x.productId == prodId) { iapproductInfo = x; break; } } if (iapproductInfo == null) { return(0f); } string s = (!string.IsNullOrEmpty(iapproductInfo.unformattedPrice)) ? iapproductInfo.unformattedPrice : iapproductInfo.formattedPrice; try { return(float.Parse(s)); } catch { return(0f); } } return(0f); }
private void OnItemPurchase(IapManager.InAppPurchaseItemType type) { if (type == IapManager.InAppPurchaseItemType.WoodenLootCrate || type == IapManager.InAppPurchaseItemType.MetalLootCrate || type == IapManager.InAppPurchaseItemType.GoldenLootCrate) { this.partListingButton.UpdateNewTagState(); } }
private void UpdateInidicator(IapManager.InAppPurchaseItemType type) { if (Singleton <IapManager> .IsInstantiated()) { base.GetComponent <Renderer>().enabled = Singleton <IapManager> .Instance.IsItemPurchased(this.m_purchaseItem); } }
private void OnPurchaseSucceeded(IapManager.InAppPurchaseItemType type) { if (!string.IsNullOrEmpty(this.currentSaleKey) && type == this.saleItem) { GameProgress.SetBool(this.currentSaleKey + "_used", true, GameProgress.Location.Local); } }
private void OnPurchase(IapManager.InAppPurchaseItemType type) { base.UpdateAmount(false); if (!Singleton <IapManager> .Instance.SnoutCoinPurchasable(type)) { this.PlayPurchaseSound(); } }
public int GetProductRewardCount(IapManager.InAppPurchaseItemType itemType) { Hashtable productRewards = this.GetProductRewards(itemType); if (productRewards == null) { return(0); } return(productRewards.Count); }
private void OnItemPurchase(IapManager.InAppPurchaseItemType type) { switch (type) { case IapManager.InAppPurchaseItemType.WoodenLootCrate: case IapManager.InAppPurchaseItemType.MetalLootCrate: case IapManager.InAppPurchaseItemType.GoldenLootCrate: case IapManager.InAppPurchaseItemType.WoodenLootCrateSale: case IapManager.InAppPurchaseItemType.MetalLootCrateSale: case IapManager.InAppPurchaseItemType.GoldenLootCrateSale: this.ButtonAwake(); break; } }
public string GetProductLocalizationKey(IapManager.InAppPurchaseItemType itemType) { string text = Singleton <IapManager> .Instance.GetProductIdByItem(itemType); if (string.IsNullOrEmpty(text)) { return(string.Empty); } text = text.Substring(text.LastIndexOf(".") + 1); if (this.virtualCatalogDictionary != null && this.virtualCatalogDictionary.ContainsKey(text)) { return(this.virtualCatalogDictionary[text].localizationKey); } return(string.Empty); }
public int GetProductPrice(IapManager.InAppPurchaseItemType itemType) { string productIdByItem = Singleton <IapManager> .Instance.GetProductIdByItem(itemType); if (string.IsNullOrEmpty(productIdByItem)) { return(-1); } string key = productIdByItem.Substring(productIdByItem.LastIndexOf(".") + 1); if (this.virtualCatalogDictionary != null && this.virtualCatalogDictionary.ContainsKey(key)) { return(this.virtualCatalogDictionary[key].price); } return(-1); }
private float CalculatePercentage() { this.purchaseInfo.CheckOnSale(); IapManager.InAppPurchaseItemType inAppPurchaseItemType = (!this.purchaseInfo.isSaleItem) ? this.purchaseInfo.purchaseItem : this.purchaseInfo.saleItem; float num = (float)Singleton <IapManager> .Instance.GetPurchaseItemTypeCount(inAppPurchaseItemType); float num2 = (float)Singleton <IapManager> .Instance.GetPurchaseItemTypeCount(this.compareType); float price = this.GetPrice(inAppPurchaseItemType); float price2 = this.GetPrice(this.compareType); if (num == 0f || num2 == 0f || price == 0f || price2 == 0f) { return(0f); } return(num / price / (num2 / price2) - 1f); }
private void OnPurchase(IapManager.InAppPurchaseItemType item) { for (int i = 0; i < this.items.Length; i++) { if (this.items[i] == item) { this.particles.transform.position = base.transform.position; this.particles.Play(); Singleton <AudioManager> .Instance.Play2dEffect(WPFMonoBehaviour.gameData.commonAudioCollection.snoutCoinPurchase); if (this.buildMenu != null) { this.buildMenu.RefreshPowerUpCounts(); } break; } } }
private void HandleIapManageronPurchaseSucceeded(IapManager.InAppPurchaseItemType type) { this.autoBuildButton.transform.Find("AmountText").GetComponent <TextMesh>().text = GameProgress.BluePrintCount().ToString(); }
private void HandleIapManageronPurchaseFailed(IapManager.InAppPurchaseItemType type) { this.m_loader.SetActive(false); }
private void HandleIapManageronPurchaseSucceeded(IapManager.InAppPurchaseItemType type) { this.SetVisible(false); }
private void Purchase(IapManager.InAppPurchaseItemType type) { this.m_loader.SetActive(true); Singleton <IapManager> .Instance.PurchaseItem(type); }
private void UnlockScreen(IapManager.InAppPurchaseItemType type = IapManager.InAppPurchaseItemType.Undefined) { this.m_LockOverlay.SetActive(false); Singleton <GuiManager> .Instance.IsEnabled = true; }
private void HandleIapManageronPurchaseSucceeded(IapManager.InAppPurchaseItemType type) { this.ShowUnlocked(); }
private void HandleIapManagerOnPurchaseSucceeded(IapManager.InAppPurchaseItemType type) { }