収穫機の強化レベル処理追加

This commit is contained in:
kimura 2021-08-02 17:25:56 +09:00
parent a1e0da29ca
commit 5934a241d7
1 changed files with 25 additions and 3 deletions

View File

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