protected override void Purchase(MarketLot lot) { Debug.Log("IOSBilling. Purchase lot:" + lot); if (_canMakePayments) { StoreKitBinding.purchaseProduct(lot.ProductIOSIdentifier, 1); } }
static MarketLot() { RemoveAds = new MarketLot { Id = "RemoveAds", Price = 0.99f, ProductIOSIdentifier = "com.consumedmedia.retro2048removeads", ProductAndroidIdentifier = "com.consumedmedia.retro2048removeads" }; UndoPack1 = new MarketLot { Id = "UndoPack1", Amount = 5, Price = 0.99f, ProductIOSIdentifier = "com.consumedmedia.retro2048.pack1", ProductAndroidIdentifier = "com.consumedmedia.retro2048.pack1" }; UndoPack2 = new MarketLot { Id = "UndoPack2", Amount = 15, Price = 1.99f, ProductIOSIdentifier = "com.consumedmedia.retro2048.pack2", ProductAndroidIdentifier = "com.consumedmedia.retro2048.pack2" }; UndoPack3 = new MarketLot { Id = "UndoPack3", Amount = 50, Price = 5.99f, ProductIOSIdentifier = "com.consumedmedia.retro2048.pack3", ProductAndroidIdentifier = "com.consumedmedia.retro2048.pack3" }; AllLots = new List <MarketLot> { RemoveAds, UndoPack1, UndoPack2, UndoPack3 }; }
protected void CompletePurchase(MarketLot lot) { Debug.Log("Purchase completed:" + lot.Id); if (lot == MarketLot.UndoPack1) { UndoBtn.undoCnt += 5; } else if (lot == MarketLot.UndoPack2) { UndoBtn.undoCnt += 15; } else if (lot == MarketLot.UndoPack3) { UndoBtn.undoCnt += 50; } else if (lot == MarketLot.RemoveAds) { UserData.adRemoved = true; GoogleMobileAdsPlugin.HideBannerView(); } }
protected override void Purchase(MarketLot lot) { CompletePurchase(lot); }
protected override void Purchase(MarketLot lot) { Debug.Log("AndroidBilling. Purchase lot:" + lot); GoogleIAB.purchaseProduct(lot.ProductAndroidIdentifier); }
protected override void Purchase(MarketLot lot) { Debug.Log("Error! Call AndroidBilling Purchase from not Android build."); }
protected override void Purchase(MarketLot lot) { Debug.Log("Error! Call IOSBilling Purchase from not iOS build."); }
protected abstract void Purchase(MarketLot lot);
public static void RequestPurchase(MarketLot marketLot) { _instance.Purchase(marketLot); }