From 5934a241d7123846f7e0df9321fecdded2a35167 Mon Sep 17 00:00:00 2001 From: kimura Date: Mon, 2 Aug 2021 17:25:56 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8F=8E=E7=A9=AB=E6=A9=9F=E3=81=AE=E5=BC=B7?= =?UTF-8?q?=E5=8C=96=E3=83=AC=E3=83=99=E3=83=AB=E5=87=A6=E7=90=86=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/CornField/Scripts/CornField.cs | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs b/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs index 883b6e92..535e168c 100644 --- a/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs +++ b/popcorn/Assets/MyGame/Scenes/CornField/Scripts/CornField.cs @@ -98,10 +98,11 @@ public class CornField : MonoBehaviour { // 収穫 VibrationManager.Instance.PlayVibrationOnce(); - for (int j = 0; j < GetHarvestCount(lineData.Seedlings[index].level); j++) + var harvestCount = GetHarvestCount(lineData.Seedlings[index].level); + var harvestedCorn = GetHarvestedCornCount(gameData.MachineLevel); + gameData.cornSeed += harvestedCorn * harvestCount; + for (int j = 0; j < harvestCount; j++) { - var harvestedCorn = 20; - harvestedCornCount.Value += harvestedCorn; var harvestAnimation = Instantiate(harvestPrefab, seedling.transform); this.CallWaitForSeconds(.5f, () => { @@ -218,4 +219,25 @@ public class CornField : MonoBehaviour throw new ArgumentOutOfRangeException(nameof(rank), rank, null); } } + + private int GetHarvestedCornCount(int level) + { + switch (level) + { + case 1: + return 20; + case 2: + return 25; + case 3: + return 30; + case 4: + return 35; + case 5: + return 40; + case 6: + return 45; + default: + throw new ArgumentOutOfRangeException(nameof(level), level, null); + } + } }