diff --git a/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs b/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs index e9dc9f00..082f1719 100644 --- a/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs +++ b/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs @@ -54,8 +54,14 @@ public class CornField : MonoBehaviour // データ var gameData = GameDataManager.GameData; CoinManager.Instance.ChangeCoin(gameData.Coin); - HeartMeter.Instance.Initialize(); - HeartMeter.Instance.SetHeart(gameData.Heart); + HeartMeter.Instance.Initialize(gameData.ViewedShopLevel, gameData.Heart); + GameDataObserver.Instance.ShopLevelUpdate + .Where(x => x) + .Subscribe(x => + { + LocalCacheManager.Save(ShopLevelUp.DataTag, gameData.ViewedShopLevel + 1); + TransitionManager.Instance.LoadSceneAdditive(GameScenes.StoreLevel); + }).AddTo(this); counterView.Initialize(gameData.CornSeed); SetData(); diff --git a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs index 52abf7d1..2fbf79c1 100644 --- a/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs +++ b/popcorn/Assets/MyGame/Scenes/Main/Scripts/KitchenManager.cs @@ -27,8 +27,14 @@ public class KitchenManager : MonoBehaviour var gameData = GameDataManager.GameData; CoinManager.Instance.ChangeCoin(gameData.Coin); - HeartMeter.Instance.Initialize(); - HeartMeter.Instance.SetHeart(gameData.Heart); + HeartMeter.Instance.Initialize(gameData.ViewedShopLevel, gameData.Heart); + GameDataObserver.Instance.ShopLevelUpdate + .Where(x => x) + .Subscribe(x => + { + LocalCacheManager.Save(ShopLevelUp.DataTag, gameData.ViewedShopLevel + 1); + TransitionManager.Instance.LoadSceneAdditive(GameScenes.StoreLevel); + }).AddTo(this); kitchenView.Initialize(); adButton.gameObject.SetActive(false); @@ -45,9 +51,7 @@ public class KitchenManager : MonoBehaviour kitchenView.SetNormalAnimation(); }).AddTo(this); #endif - - TransitionManager.Instance.LoadSceneAdditive(GameScenes.StoreLevel); - + // 大量注文 var bulkOrderList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.BulkOrderDataSheet); var result = CheckBulkOrder(); diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs index 48ff89b8..3d2e5820 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/MarketManager.cs @@ -22,8 +22,14 @@ public class MarketManager : MonoBehaviour { var gameData = GameDataManager.GameData; CoinManager.Instance.ChangeCoin(gameData.Coin); - HeartMeter.Instance.Initialize(); - HeartMeter.Instance.SetHeart(gameData.Heart); + HeartMeter.Instance.Initialize(gameData.ViewedShopLevel, gameData.Heart); + GameDataObserver.Instance.ShopLevelUpdate + .Where(x => x) + .Subscribe(x => + { + LocalCacheManager.Save(ShopLevelUp.DataTag, gameData.ViewedShopLevel + 1); + TransitionManager.Instance.LoadSceneAdditive(GameScenes.StoreLevel); + }).AddTo(this); market = Market.Instance; productDataList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ProductDataSheet); diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs index 247e6bef..652d1512 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs @@ -24,8 +24,14 @@ public class ProductManagement : MonoBehaviour state.Value = ManagementState.None; var gameData = GameDataManager.GameData; CoinManager.Instance.ChangeCoin(gameData.Coin); - HeartMeter.Instance.Initialize(); - HeartMeter.Instance.SetHeart(gameData.Heart); + HeartMeter.Instance.Initialize(gameData.ViewedShopLevel, gameData.Heart); + GameDataObserver.Instance.ShopLevelUpdate + .Where(x => x) + .Subscribe(x => + { + LocalCacheManager.Save(ShopLevelUp.DataTag, gameData.ViewedShopLevel + 1); + TransitionManager.Instance.LoadSceneAdditive(GameScenes.StoreLevel); + }).AddTo(this); // 補充方法設定 view.SetRefillType(gameData.RefillMode); diff --git a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs index 53026fef..e92161ab 100644 --- a/popcorn/Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs +++ b/popcorn/Assets/MyGame/Scenes/shopping/Scripts/Shopping.cs @@ -16,8 +16,14 @@ public class Shopping : MonoBehaviour var gameData = GameDataManager.GameData; CoinManager.Instance.ChangeCoin(gameData.Coin); - HeartMeter.Instance.Initialize(); - HeartMeter.Instance.SetHeart(gameData.Heart); + HeartMeter.Instance.Initialize(gameData.ViewedShopLevel, gameData.Heart); + GameDataObserver.Instance.ShopLevelUpdate + .Where(x => x) + .Subscribe(x => + { + LocalCacheManager.Save(ShopLevelUp.DataTag, gameData.ViewedShopLevel + 1); + TransitionManager.Instance.LoadSceneAdditive(GameScenes.StoreLevel); + }).AddTo(this); // 一覧データ var shopDataList = SpreadsheetDataManager.Instance.GetBaseDataList(Const.ShopDataSheet);