public ShopData(IAPManager.IAPProduct product, int tier, int price, int number) { this.product = product; this.tier = tier; this.price = price; this.number = number; }
void RemovePurchasingItem(string productId) { if (purchasingList.Contains(productId)) { purchasingList.Remove(productId); IAPManager.IAPProduct product = IAPManager.GetInstance().IDProductMap[productId]; ChangeItemDisplayState(product, false); } }
void AddPurchasingItem(string productId) { if (purchasingList.Contains(productId) == false) { purchasingList.Add(productId); IAPManager.IAPProduct product = IAPManager.GetInstance().IDProductMap[productId]; ChangeItemDisplayState(product, true); } }
void InitializePurchsingList(string purchasingData) { string[] dataStrings = purchasingData.Split(new char[] { ',' }); foreach (string data in dataStrings) { purchasingList.Add(data); IAPManager.IAPProduct product = IAPManager.GetInstance().IDProductMap[data]; ChangeItemDisplayState(product, true); } }
public static ShopData GetShopData(IAPManager.IAPProduct product) { foreach (ShopData shopData in gameShopData) { if (shopData.product == product) { return(shopData); } } return(null); }
public void ChangeItemDisplayState(IAPManager.IAPProduct product, bool isPurchasing) { foreach (ShopItem shopItem in shopItems) { if (shopItem.Data.product == product) { shopItem.ChangeDisplayState(isPurchasing); break; } } }
bool CheckIsPurchasing(IAPManager.IAPProduct product) { string productId = IAPManager.GetInstance().productIDMap[product]; foreach (string existId in purchasingList) { if (existId.Equals(productId)) { return(true); } } return(false); }
void RequestProductsFinished(string shopDataString) { ArrayList shopDataList = KTPlaySDKJson.KTJSON.jsonDecode(shopDataString) as ArrayList; foreach (Hashtable hashtable in shopDataList) { if (hashtable.Contains("price")) { string productId = hashtable["id"].ToString(); int price = Convert.ToInt32(hashtable["price"]); IAPManager.IAPProduct product = IAPManager.GetInstance().IDProductMap[productId]; foreach (ShopData shopData in ShopData.gameShopData) { if (shopData.product == product) { shopData.price = price; break; } } } } RefreshShopData(); }