初期コーンの向きランダム化

This commit is contained in:
kimura 2021-07-12 18:38:28 +09:00
parent caa8af047c
commit 9316c3da40
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ public class Corn : MonoBehaviour
private void Start() private void Start()
{ {
rigidbody.MovePosition(new Vector2(Random.value * 2 - 1, Random.value * 2 - 1)); rigidbody.MovePosition(new Vector2(Random.value * 2 - 1, Random.value * 2 - 1));
rigidbody.SetRotation(Random.value * 360);
// コーンが飛んでいく // コーンが飛んでいく
this.ObserveEveryValueChanged(x => x.rigidbody.velocity.magnitude) this.ObserveEveryValueChanged(x => x.rigidbody.velocity.magnitude)