From 9c7980820cfcf5e93c15739c6b917605d5578769 Mon Sep 17 00:00:00 2001 From: kimura Date: Wed, 22 Sep 2021 15:08:20 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AC=E3=82=B7=E3=83=94=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E4=BF=AE=E6=AD=A3/=E3=83=9D=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=B3=E8=BF=BD=E5=8A=A0=E5=87=A6=E7=90=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyGame/Scenes/Cooking/Scripts/CookingResult.cs | 7 +++++-- .../Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs | 10 +++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CookingResult.cs b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CookingResult.cs index 427061bb..50b0575f 100644 --- a/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CookingResult.cs +++ b/popcorn/Assets/MyGame/Scenes/Cooking/Scripts/CookingResult.cs @@ -106,10 +106,13 @@ public class CookingResult : MonoBehaviour gameData.ShopStock.AddRange(Enumerable.Repeat(recipe.RecipeId, stockCount)); remain -= stockCount; + // 空タンク並び替え + gameData.StorageTanks = gameData.StorageTanks.OrderBy(tank => tank.IsEmpty).ToList(); // 空きのタンクを確認 gameData.StorageTanks - .Where(tank => tank.IsEmpty || tank.FlavorId == recipe.RecipeId && !tank.IsFull) - .Select((tank, i) => (i, space: tank.Capacity - tank.Stock)) + .Select((tank, i) => (tank, i)) + .Where(x => x.tank.IsEmpty || x.tank.FlavorId == recipe.RecipeId && !x.tank.IsFull) + .Select(x => (x.i, space: x.tank.Capacity - x.tank.Stock)) .OrderBy(x => x.space) .ToList() .ForEach(x => diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs index c1eedf2e..b5321a5d 100644 --- a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs +++ b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeData.cs @@ -29,7 +29,7 @@ public class RecipeData CornAmount = 150, Flavors = new List<(int id, int amount)> { - (1, 1) + (2, 1) } }, new RecipeData @@ -41,7 +41,7 @@ public class RecipeData CornAmount = 150, Flavors = new List<(int id, int amount)> { - (6, 1) + (7, 1) } }, new RecipeData @@ -53,7 +53,7 @@ public class RecipeData CornAmount = 150, Flavors = new List<(int id, int amount)> { - (2, 1) + (3, 1) } }, new RecipeData @@ -65,8 +65,8 @@ public class RecipeData CornAmount = 150, Flavors = new List<(int id, int amount)> { - (1, 1), - (6, 1), + (2, 1), + (7, 1), } }, };