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); + } + } }