StrageTank不要変数削除

This commit is contained in:
kimura 2021-10-08 14:50:23 +09:00
parent 4f25312cef
commit 29e48856e1
4 changed files with 14 additions and 5 deletions

View File

@ -90,12 +90,12 @@ public class DebugOptionManager : MonoBehaviour
gameData.StorageTanks = new List<StorageTank> gameData.StorageTanks = new List<StorageTank>
{ {
// new StorageTank(){Id = 1, Capacity = 50, FlavorId = 1, Stocks = new List<ProductStockData>{new ProductStockData{Rarity = ProductRarity.Normal, Stock = 0}}}, // new StorageTank(){Id = 1, Capacity = 50, FlavorId = 1, Stocks = new List<ProductStockData>{new ProductStockData{Rarity = ProductRarity.Normal, Stock = 0}}},
new StorageTank(){Id = 2, Capacity = 50, FlavorId = 2, Stocks = new List<ProductStockData> new StorageTank(){Capacity = 50, FlavorId = 2, Stocks = new List<ProductStockData>
{ {
new ProductStockData{Rarity = ProductRarity.Normal, Stock = 1}, new ProductStockData{Rarity = ProductRarity.Normal, Stock = 1},
new ProductStockData{Rarity = ProductRarity.Yellow, Stock = 20}, new ProductStockData{Rarity = ProductRarity.Yellow, Stock = 20},
}}, }},
new StorageTank(){Id = 3, Capacity = 50, FlavorId = 1, Stocks = new List<ProductStockData> new StorageTank(){Capacity = 50, FlavorId = 1, Stocks = new List<ProductStockData>
{ {
new ProductStockData{Rarity = ProductRarity.Normal, Stock = 1}, new ProductStockData{Rarity = ProductRarity.Normal, Stock = 1},
new ProductStockData{Rarity = ProductRarity.Yellow, Stock = 9}, 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.Gold, Stock = 10},
new ProductStockData{Rarity = ProductRarity.Rainbow, Stock = 20}, new ProductStockData{Rarity = ProductRarity.Rainbow, Stock = 20},
}}, }},
new StorageTank(){Id = 4, Capacity = 50, FlavorId = 1, Stocks = new List<ProductStockData>{new ProductStockData{Rarity = ProductRarity.Gold, Stock = 4}}}, new StorageTank(){Capacity = 50, FlavorId = 1, Stocks = new List<ProductStockData>{new ProductStockData{Rarity = ProductRarity.Gold, Stock = 4}}},
}; };
}).AddTo(this); }).AddTo(this);

View File

@ -81,7 +81,7 @@ public class ProductManagement : MonoBehaviour
Action<int> purchaseAction = amount => Action<int> 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.SetData(gameData.StorageTanks[tankView.TankNumber - 1]);
tankView.SetState(TankState.Unlock); tankView.SetState(TankState.Unlock);
CoinManager.Instance.SubCoin(shopData.price); CoinManager.Instance.SubCoin(shopData.price);

View File

@ -5,7 +5,6 @@ using UnityEngine;
public class StorageTank public class StorageTank
{ {
// タンクID, タンク内のフレーバーID, フレーバーの個数 // タンクID, タンク内のフレーバーID, フレーバーの個数
public int Id;
public int Capacity; public int Capacity;
public int FlavorId; public int FlavorId;
public int Stock public int Stock

View File

@ -207,6 +207,15 @@ public sealed class GameData {
{ {
MyRecipes = new[] {Const.DefaultRecipeId}; MyRecipes = new[] {Const.DefaultRecipeId};
} }
if (StorageTanks.Count < 1)
{
StorageTanks.Add(new StorageTank
{
Capacity = 50,
FlavorId = -1,
}
);
}
if (Pans.Length < 1) if (Pans.Length < 1)
{ {
Pans = new[] {Const.DefaultPanId}; Pans = new[] {Const.DefaultPanId};
@ -221,6 +230,7 @@ public sealed class GameData {
MyRecipes = MyRecipes ?? new int[0]; MyRecipes = MyRecipes ?? new int[0];
Material = Material ?? new List<MaterialData>(); Material = Material ?? new List<MaterialData>();
ShopStock = ShopStock ?? new List<ProductStockData>(); ShopStock = ShopStock ?? new List<ProductStockData>();
StorageTanks = StorageTanks ?? new List<StorageTank>();
Pans = Pans ?? new int[0]; Pans = Pans ?? new int[0];
TotalSalesList = TotalSalesList ?? new List<ProductStockData>(); TotalSalesList = TotalSalesList ?? new List<ProductStockData>();
AchievedMission = achievedMission?.ToList() ?? new List<int>(); AchievedMission = achievedMission?.ToList() ?? new List<int>();