【商品】安卓
parent
4829a07f94
commit
a6facbe5ee
|
@ -13,7 +13,6 @@ namespace Gameplay.Manager
|
|||
public class ShopManager : Singlenton<ShopManager>, IInitable
|
||||
{
|
||||
private Dictionary<PropType, int> _unusedPropCount;
|
||||
public string Platform = "ios";
|
||||
public bool IsDebug;
|
||||
|
||||
private Dictionary<string, int> _consumableGoods;
|
||||
|
@ -48,11 +47,10 @@ namespace Gameplay.Manager
|
|||
private void InitProducts()
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
Platform = "android";
|
||||
_consumableGoods = new Dictionary<string, int>()
|
||||
{
|
||||
{ "android_coinbox_100", 100 }, { "android_coinbox_600", 600 },
|
||||
{ "ios_CoinBox_1600", 1600 }
|
||||
{ "android_coinbox_1600", 1600 }
|
||||
};
|
||||
_nonConsumableGoods = new Dictionary<string, int>();
|
||||
#else
|
||||
|
|
|
@ -85,6 +85,7 @@ public class IAPHandle : IStoreListener
|
|||
//Add Product
|
||||
foreach (var consumableGoods in ConsumableGoods)
|
||||
{
|
||||
DebugUtil.Log("添加商品:{0}", consumableGoods);
|
||||
builder.AddProduct(consumableGoods, ProductType.Consumable);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ public class UIMainShopController : UIWindow
|
|||
|
||||
protected override void OnAwake()
|
||||
{
|
||||
var platform = ShopManager.Instance.Platform;
|
||||
EventManager.Instance.Register(EventManager.EventName.RefreshCoin, RefreshCoins);
|
||||
|
||||
_rawImageGaussianBlurMask = GetComponent<RawImage>("GaussianBlurMask");
|
||||
|
@ -28,19 +27,31 @@ public class UIMainShopController : UIWindow
|
|||
{
|
||||
_biEventFirst = EventFirst.fte_buy_coin_small;
|
||||
_biEvent = Event.click_buy_coin_small;
|
||||
ShopToBuy(platform + "_CoinBox_100");
|
||||
#if UNITY_ANDROID
|
||||
ShopToBuy("android_coinbox_100");
|
||||
#else
|
||||
ShopToBuy("ios_CoinBox_100");
|
||||
#endif
|
||||
});
|
||||
BindButton("MainShop/CoinsList/Viewport/Content/CoinMediumPack/Btn_Buy", () =>
|
||||
{
|
||||
_biEventFirst = EventFirst.fte_buy_coin_medium;
|
||||
_biEvent = Event.click_buy_coin_medium;
|
||||
ShopToBuy(platform + "_CoinBox_600");
|
||||
#if UNITY_ANDROID
|
||||
ShopToBuy("android_coinbox_600");
|
||||
#else
|
||||
ShopToBuy("ios_CoinBox_600");
|
||||
#endif
|
||||
});
|
||||
BindButton("MainShop/CoinsList/Viewport/Content/CoinLargePack/Btn_Buy", () =>
|
||||
{
|
||||
_biEventFirst = EventFirst.fte_buy_coin_large;
|
||||
_biEvent = Event.click_buy_coin_large;
|
||||
ShopToBuy(platform + "_CoinBox_1600");
|
||||
#if UNITY_ANDROID
|
||||
ShopToBuy("android_coinbox_1600");
|
||||
#else
|
||||
ShopToBuy("ios_CoinBox_1600");
|
||||
#endif
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue