From 29e48856e1344654318040f36007f634bdcca868 Mon Sep 17 00:00:00 2001 From: kimura Date: Fri, 8 Oct 2021 14:50:23 +0900 Subject: [PATCH] =?UTF-8?q?StrageTank=E4=B8=8D=E8=A6=81=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/DebugOption/Scripts/DebugOptionManager.cs | 6 +++--- .../Scenes/marketing/Scripts/ProductManagement.cs | 2 +- .../MyGame/Scenes/marketing/Scripts/StorageTank.cs | 1 - popcorn/Assets/MyGame/Scripts/GameDataManager.cs | 10 ++++++++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs index c5482e48..fa28f810 100644 --- a/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs +++ b/popcorn/Assets/MyGame/Scenes/DebugOption/Scripts/DebugOptionManager.cs @@ -90,12 +90,12 @@ public class DebugOptionManager : MonoBehaviour gameData.StorageTanks = new List { // new StorageTank(){Id = 1, Capacity = 50, FlavorId = 1, Stocks = new List{new ProductStockData{Rarity = ProductRarity.Normal, Stock = 0}}}, - new StorageTank(){Id = 2, Capacity = 50, FlavorId = 2, Stocks = new List + new StorageTank(){Capacity = 50, FlavorId = 2, Stocks = new List { new ProductStockData{Rarity = ProductRarity.Normal, Stock = 1}, new ProductStockData{Rarity = ProductRarity.Yellow, Stock = 20}, }}, - new StorageTank(){Id = 3, Capacity = 50, FlavorId = 1, Stocks = new List + new StorageTank(){Capacity = 50, FlavorId = 1, Stocks = new List { new ProductStockData{Rarity = ProductRarity.Normal, Stock = 1}, new ProductStockData{Rarity = ProductRarity.Yellow, Stock = 9}, @@ -104,7 +104,7 @@ public class DebugOptionManager : MonoBehaviour new ProductStockData{Rarity = ProductRarity.Gold, Stock = 10}, new ProductStockData{Rarity = ProductRarity.Rainbow, Stock = 20}, }}, - new StorageTank(){Id = 4, Capacity = 50, FlavorId = 1, Stocks = new List{new ProductStockData{Rarity = ProductRarity.Gold, Stock = 4}}}, + new StorageTank(){Capacity = 50, FlavorId = 1, Stocks = new List{new ProductStockData{Rarity = ProductRarity.Gold, Stock = 4}}}, }; }).AddTo(this); diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs index 812b7bbd..1cef717f 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/ProductManagement.cs @@ -81,7 +81,7 @@ public class ProductManagement : MonoBehaviour Action purchaseAction = amount => { // タンク追加 - gameData.StorageTanks.Add(new StorageTank() {Id = tankView.TankNumber, Capacity = 50}); + gameData.StorageTanks.Add(new StorageTank() {Capacity = 50}); tankView.SetData(gameData.StorageTanks[tankView.TankNumber - 1]); tankView.SetState(TankState.Unlock); CoinManager.Instance.SubCoin(shopData.price); diff --git a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/StorageTank.cs b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/StorageTank.cs index 8c8096b1..fc0eb446 100644 --- a/popcorn/Assets/MyGame/Scenes/marketing/Scripts/StorageTank.cs +++ b/popcorn/Assets/MyGame/Scenes/marketing/Scripts/StorageTank.cs @@ -5,7 +5,6 @@ using UnityEngine; public class StorageTank { // タンクID, タンク内のフレーバーID, フレーバーの個数 - public int Id; public int Capacity; public int FlavorId; public int Stock diff --git a/popcorn/Assets/MyGame/Scripts/GameDataManager.cs b/popcorn/Assets/MyGame/Scripts/GameDataManager.cs index bc424a2a..d8185d10 100644 --- a/popcorn/Assets/MyGame/Scripts/GameDataManager.cs +++ b/popcorn/Assets/MyGame/Scripts/GameDataManager.cs @@ -207,6 +207,15 @@ public sealed class GameData { { MyRecipes = new[] {Const.DefaultRecipeId}; } + if (StorageTanks.Count < 1) + { + StorageTanks.Add(new StorageTank + { + Capacity = 50, + FlavorId = -1, + } + ); + } if (Pans.Length < 1) { Pans = new[] {Const.DefaultPanId}; @@ -221,6 +230,7 @@ public sealed class GameData { MyRecipes = MyRecipes ?? new int[0]; Material = Material ?? new List(); ShopStock = ShopStock ?? new List(); + StorageTanks = StorageTanks ?? new List(); Pans = Pans ?? new int[0]; TotalSalesList = TotalSalesList ?? new List(); AchievedMission = achievedMission?.ToList() ?? new List();