From 950c9fe8f59fd0148a934317814ad5ce89a1bdaf Mon Sep 17 00:00:00 2001 From: kimura Date: Wed, 10 Aug 2022 15:38:14 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AB=E3=82=B9=E3=82=BF=E3=83=9E=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E7=B4=A0=E6=9D=90=E3=81=AE=E7=8D=B2=E5=BE=97=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=82=92static=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/marketing/Scripts/ShopCustomize.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs index 971b0805..40d04249 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ShopCustomize.cs @@ -101,7 +101,7 @@ myItems {string.Join(",", gameData.ShopCustomizeMyItems.Select(x => x.ToString() ShopCustomizePurchaseDialog.ShowDialog(customizeData, false, () => { PurchaseItem(customizeData); - Market.Instance.UpdateBonus(GetBonusList(gameData.ShopCustomizeLevel)); + customizeView.SetLevel(gameData.ShopCustomizeLevel); selectSubject.OnNext(Unit.Default); }); }).AddTo(this); @@ -116,19 +116,24 @@ myItems {string.Join(",", gameData.ShopCustomizeMyItems.Select(x => x.ToString() } } - private void PurchaseItem(ShopCustomizeData customizeData) + private static void PurchaseItem(ShopCustomizeData customizeData) + { + ShopCustomizeCoinManager.Instance.SubCoin(customizeData.price); + GameDataManager.GameData.ShopCustomizeCoin = ShopCustomizeCoinManager.Instance.OwnCoin; + GetItem(customizeData); + GameDataManager.SaveGameData(); + } + + public static void GetItem(ShopCustomizeData customizeData) { var gameData = GameDataManager.GameData; - ShopCustomizeCoinManager.Instance.SubCoin(customizeData.price); - gameData.ShopCustomizeCoin = ShopCustomizeCoinManager.Instance.OwnCoin; gameData.ShopCustomizePoint += customizeData.point; gameData.ShopCustomizeMyItems = gameData.ShopCustomizeMyItems.Append(customizeData.id).ToArray(); var customizeLevelList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopCustomizeLevelDataSheet); var level = customizeLevelList.LastOrDefault(data => data.point <= gameData.ShopCustomizePoint)?.level ?? 1; gameData.ShopCustomizeLevel = level; - GameDataManager.SaveGameData(); - customizeView.SetLevel(gameData.ShopCustomizeLevel); + Market.Instance.UpdateBonus(GetBonusList(gameData.ShopCustomizeLevel)); } /*