@@ -49,39 +49,29 @@ dependency `extensions-unity-1.0.4`
4949
5050``` csharp
5151
52- public struct IapProduct
52+ public static class IapProduct
5353 {
54- public const string ID_COIN = " com.test.coin" ;
55- public static IapDataProduct PurchaseCoin ()
56- {
57- return IapManager .PurchaseProduct (IapSettings .Instance .IapDataProducts [0 ]);
58- }
59-
60- public static bool IsPurchasedCoin ()
61- {
62- return IapManager .IsPurchasedProduct (IapSettings .Instance .IapDataProducts [0 ]);
63- }
64-
65- public static string LocalizedPriceCoin ()
66- {
67- return IapManager .LocalizedPriceProduct (IapSettings .Instance .IapDataProducts [0 ]);
68- }
69-
70- public const string ID_REMOVEADS = " com.test.removeads" ;
71- public static IapDataProduct PurchaseRemoveads ()
72- {
54+ public const string ID_REMOVEADS = " com.test.removeads" ;
55+ public static IapDataProduct PurchaseRemoveads ()
56+ {
57+ return IapManager .PurchaseProduct (IapSettings .Instance .IapDataProducts [0 ]);
58+ }
59+
60+ public static bool IsPurchasedRemoveads ()
61+ {
62+ return IapManager .IsPurchasedProduct (IapSettings .Instance .IapDataProducts [0 ]);
63+ }
64+
65+ public const string ID_1000GEM = " com.test.1000gem" ;
66+ public static IapDataProduct Purchase1000Gem ()
67+ {
7368 return IapManager .PurchaseProduct (IapSettings .Instance .IapDataProducts [1 ]);
74- }
69+ }
7570
76- public static bool IsPurchasedRemoveads ()
77- {
78- return IapManager .IsPurchasedProduct (IapSettings .Instance .IapDataProducts [1 ]);
79- }
80-
81- public static string LocalizedPriceRemoveads ()
82- {
83- return IapManager .LocalizedPriceProduct (IapSettings .Instance .IapDataProducts [1 ]);
84- }
71+ public static bool IsPurchased1000Gem ()
72+ {
73+ return IapManager .IsPurchasedProduct (IapSettings .Instance .IapDataProducts [1 ]);
74+ }
8575
8676 }
8777
@@ -91,16 +81,6 @@ dependency `extensions-unity-1.0.4`
9181- Example 1:
9282``` csharp
9383 public Button buttonRemoveAds ;
94- public TextMeshProUGUI textLocalizedPriceRemoveAds ;
95-
96- /// <summary >
97- /// set text localized price for RemoveAds product
98- /// </summary >
99- void SetupTextPrice ()
100- {
101- textLocalizedPriceRemoveAds .text = IapProduct .LocalizedPriceRemoveads ();
102- }
103-
10484 /// <summary >
10585 /// refresh ui button remove ads
10686 /// disable buttonRemoveAds if RemoveAds product has been purchased
0 commit comments