【商品】安卓

Android_release
zhangaotian 2024-08-14 12:56:04 +08:00
parent 4829a07f94
commit a6facbe5ee
3 changed files with 20 additions and 10 deletions

View File

@ -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

View File

@ -85,6 +85,7 @@ public class IAPHandle : IStoreListener
//Add Product
foreach (var consumableGoods in ConsumableGoods)
{
DebugUtil.Log("添加商品:{0}", consumableGoods);
builder.AddProduct(consumableGoods, ProductType.Consumable);
}

View File

@ -17,30 +17,41 @@ public class UIMainShopController : UIWindow
protected override void OnAwake()
{
var platform = ShopManager.Instance.Platform;
EventManager.Instance.Register(EventManager.EventName.RefreshCoin, RefreshCoins);
_rawImageGaussianBlurMask = GetComponent<RawImage>("GaussianBlurMask");
_txtCoins = FindObj("UI_LiuHaiTop/CoinBar/Txt_CoinNumber").GetComponent<TextMeshProUGUI>();
BindButton("MainShop/Btn_Close", OnWindowClose);
BindButton("MainShop/CoinsList/Viewport/Content/CoinSmallPack/Btn_Buy", () =>
{
_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
});
}
@ -56,7 +67,7 @@ public class UIMainShopController : UIWindow
EventManager.Instance.Send(EventManager.EventName.HideGfx);
GfxManager.Instance.LoadGfx("Effect_Sequin");
}
private void OnWindowClose()
{
CloseWindow(true);