유니티(Unity) | Random Point On Circle
Programming/Unity
2017. 10. 8. 13:48
1 2 3 4 5 6 7 | public Vector3 RandomPointOnCircle(float radius) { float u = Random.Range(0f, 1f); float theta = u * (Mathf.PI * 2f); return new Vector3(radius * Mathf.Cos(theta), radius * Mathf.Sin(theta), 0f); } | cs |