コーンの弾ける時間をロジック化

This commit is contained in:
kimura 2021-07-21 14:47:44 +09:00
parent f0bf098efe
commit 54927fb4ce
1 changed files with 18 additions and 2 deletions

View File

@ -130,12 +130,28 @@ public class CornManager : MonoBehaviour
}
}
cornArray = new Corn[cornSpawnCount];
// コーン生成
var popTime = 1f;
for (int i = 0; i < cornSpawnCount; i++)
{
// コーン生成テーブル
if (1 <= i && i <= 5)
{
popTime += 3 - (i - 1) * .5f;
}
else if (6 <= i && i <= 10)
{
popTime += 0.5f - (i - 6) * .1f;
}
else if (11 <= i)
{
popTime += .1f;
}
var corn = Instantiate(cornPrefab, cornSpawnTarget);
cornArray[i] = corn;
corn.SetCornProperty(baseCornPopTime + Random.Range(0f, cornPopRandom), cornBurntDuration + Random.Range(0f, cornBurntRandom), cornSpillSpeed, cornPopSpeed);
corn.SetCornProperty(popTime, baseCornPopTime - popTime, cornSpillSpeed, cornPopSpeed);
// 進行速度の変更時、コーン速度変更
cornGrowSpeed.TakeWhile(_ => !isCompleted).Subscribe(x =>