From a6facbe5ee0bec18b485b6665a55f17ded79b6db Mon Sep 17 00:00:00 2001 From: zhangaotian <8474238@qq.com> Date: Wed, 14 Aug 2024 12:56:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=95=86=E5=93=81=E3=80=91=E5=AE=89?= =?UTF-8?q?=E5=8D=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/Framework/Manager/ShopManager.cs | 4 +-- .../Scripts/Framework/Shop/IAP/IAPHandle.cs | 1 + .../Framework/Shop/UIMainShopController.cs | 25 +++++++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Forest/Assets/Scripts/Framework/Manager/ShopManager.cs b/Forest/Assets/Scripts/Framework/Manager/ShopManager.cs index a73f470..139a72c 100644 --- a/Forest/Assets/Scripts/Framework/Manager/ShopManager.cs +++ b/Forest/Assets/Scripts/Framework/Manager/ShopManager.cs @@ -13,7 +13,6 @@ namespace Gameplay.Manager public class ShopManager : Singlenton, IInitable { private Dictionary _unusedPropCount; - public string Platform = "ios"; public bool IsDebug; private Dictionary _consumableGoods; @@ -48,11 +47,10 @@ namespace Gameplay.Manager private void InitProducts() { #if UNITY_ANDROID - Platform = "android"; _consumableGoods = new Dictionary() { { "android_coinbox_100", 100 }, { "android_coinbox_600", 600 }, - { "ios_CoinBox_1600", 1600 } + { "android_coinbox_1600", 1600 } }; _nonConsumableGoods = new Dictionary(); #else diff --git a/Forest/Assets/Scripts/Framework/Shop/IAP/IAPHandle.cs b/Forest/Assets/Scripts/Framework/Shop/IAP/IAPHandle.cs index b6da128..62f3556 100644 --- a/Forest/Assets/Scripts/Framework/Shop/IAP/IAPHandle.cs +++ b/Forest/Assets/Scripts/Framework/Shop/IAP/IAPHandle.cs @@ -85,6 +85,7 @@ public class IAPHandle : IStoreListener //Add Product foreach (var consumableGoods in ConsumableGoods) { + DebugUtil.Log("添加商品:{0}", consumableGoods); builder.AddProduct(consumableGoods, ProductType.Consumable); } diff --git a/Forest/Assets/Scripts/Framework/Shop/UIMainShopController.cs b/Forest/Assets/Scripts/Framework/Shop/UIMainShopController.cs index ab0cacb..572c633 100644 --- a/Forest/Assets/Scripts/Framework/Shop/UIMainShopController.cs +++ b/Forest/Assets/Scripts/Framework/Shop/UIMainShopController.cs @@ -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("GaussianBlurMask"); _txtCoins = FindObj("UI_LiuHaiTop/CoinBar/Txt_CoinNumber").GetComponent(); - + 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);