コーンランダム初期位置改善
This commit is contained in:
parent
de70e03ae4
commit
6e56fa5d36
|
|
@ -62,7 +62,7 @@ public class Corn : MonoBehaviour
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
rigidbody.MovePosition(Random.insideUnitCircle);
|
rigidbody.AddForce(Random.onUnitSphere * 10f, ForceMode2D.Impulse);
|
||||||
rigidbody.SetRotation(Random.rotation);
|
rigidbody.SetRotation(Random.rotation);
|
||||||
cornSkin.ChangeSkin(condition.Value);
|
cornSkin.ChangeSkin(condition.Value);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,11 +135,12 @@ public class CornManager : MonoBehaviour
|
||||||
cornArray = new Corn[cornSpawnCount];
|
cornArray = new Corn[cornSpawnCount];
|
||||||
|
|
||||||
// コーン生成
|
// コーン生成
|
||||||
|
var shuffledArray = Enumerable.Range(0, cornSpawnCount).OrderBy(_ => Random.value).ToArray();
|
||||||
for (int i = 0; i < cornSpawnCount; i++)
|
for (int i = 0; i < cornSpawnCount; i++)
|
||||||
{
|
{
|
||||||
var corn = Instantiate(cornPrefab, cornSpawnTarget);
|
var corn = Instantiate(cornPrefab, cornSpawnTarget);
|
||||||
cornArray[i] = corn;
|
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 =>
|
cornGrowSpeed.TakeWhile(_ => !isCompleted).Subscribe(x =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue