コーン収穫修正

This commit is contained in:
kimura 2021-08-04 13:14:28 +09:00
parent 2b2de6f434
commit 3e10964258
1 changed files with 6 additions and 2 deletions

View File

@ -27,7 +27,7 @@ public class CornField : MonoBehaviour
private static readonly int maxPeriod = 60; private static readonly int maxPeriod = 60;
private static readonly int minPeriod = 45; private static readonly int minPeriod = 45;
private static readonly int harvestedFrameInterval = 3; private static readonly int harvestedFrameInterval = 3;
private static readonly float harvestedDistance = .2f; private static readonly float harvestedDistance = .6f;
private readonly CompositeDisposable compositeDisposable = new CompositeDisposable(); private readonly CompositeDisposable compositeDisposable = new CompositeDisposable();
// Start is called before the first frame update // Start is called before the first frame update
@ -110,7 +110,11 @@ public class CornField : MonoBehaviour
var seedlingTransform = seedling.transform; var seedlingTransform = seedling.transform;
for (int j = 0; j < harvestCount; j++) for (int j = 0; j < harvestCount; j++)
{ {
var pos = seedlingTransform.position + Vector3.right * (j - 1) * (harvestCount - 1) * harvestedDistance + Vector3.forward * (j - 1); var pos = seedlingTransform.position;
if (harvestCount > 1)
{
pos += Vector3.right * (j - 1) * harvestedDistance + Vector3.forward * (j - 1);
}
// 複数株 // 複数株
this.CallWaitForFrame(harvestedFrameInterval * j, () => this.CallWaitForFrame(harvestedFrameInterval * j, () =>
{ {