We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c359ea commit 2ee8156Copy full SHA for 2ee8156
Assets/JCSUnity/Scripts/Util/JCS_Random.cs
@@ -129,5 +129,14 @@ public static Vector3 PointInBounds(Bounds bounds)
129
Range(bounds.min.y, bounds.max.y),
130
Range(bounds.min.z, bounds.max.z));
131
}
132
+
133
+ /// <summary>
134
+ /// Return a random position in sphere.
135
+ /// </summary>
136
+ public static Vector3 PointInSphere(Vector3 centerPosition, float radius)
137
+ {
138
+ Vector3 randomPoint = Random.insideUnitSphere * radius;
139
+ return centerPosition + randomPoint;
140
+ }
141
142
0 commit comments