コーンランダム初期位置改善

This commit is contained in:
kimura 2021-08-10 13:16:35 +09:00
parent de70e03ae4
commit 6e56fa5d36
2 changed files with 3 additions and 2 deletions

View File

@ -62,7 +62,7 @@ public class Corn : MonoBehaviour
private void Start()
{
rigidbody.MovePosition(Random.insideUnitCircle);
rigidbody.AddForce(Random.onUnitSphere * 10f, ForceMode2D.Impulse);
rigidbody.SetRotation(Random.rotation);
cornSkin.ChangeSkin(condition.Value);

View File

@ -135,11 +135,12 @@ public class CornManager : MonoBehaviour
cornArray = new Corn[cornSpawnCount];
// コーン生成
var shuffledArray = Enumerable.Range(0, cornSpawnCount).OrderBy(_ => Random.value).ToArray();
for (int i = 0; i < cornSpawnCount; i++)
{
var corn = Instantiate(cornPrefab, cornSpawnTarget);
cornArray[i] = corn;
corn.SetCornProperty( CornPopParameters.CornPopTimeArray[i], CornPopParameters.CornBurntTimeArray[i], cornSpillSpeed, cornPopSpeed);
corn.SetCornProperty( CornPopParameters.CornPopTimeArray[shuffledArray[i]], CornPopParameters.CornBurntTimeArray[shuffledArray[i]], cornSpillSpeed, cornPopSpeed);
// 進行速度の変更時、コーン速度変更
cornGrowSpeed.TakeWhile(_ => !isCompleted).Subscribe(x =>
{