From 23148065f29bcb3eab622f4a7e03017b41d4948e Mon Sep 17 00:00:00 2001 From: "xiaohui.wang" Date: Fri, 3 Feb 2023 16:30:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B0=E6=89=8B=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=E5=A4=B1=E8=B4=A5=E7=8E=89=E7=B1=B3=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E8=B4=9F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/MyGame/Scenes/recipe/Scripts/RecipeDetailView.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeDetailView.cs b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeDetailView.cs index 88b030ba..34872f4c 100644 --- a/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeDetailView.cs +++ b/popcorn/Assets/MyGame/Scenes/recipe/Scripts/RecipeDetailView.cs @@ -258,6 +258,10 @@ public class RecipeDetailView : MonoBehaviour { var cityGameData = GameDataManager.GetCityGameData(cityId); cityGameData.CornSeed -= productData.MaterialList[0].amount; + if (cityGameData.CornSeed<0) + { + cityGameData.CornSeed = 0; + } if (cityGameData.Material.FirstOrDefault(x => x.Id == productData.MaterialList[1].id) is MaterialData material1) { material1.Amount -= productData.MaterialList[1].amount;