getrandomarrayelementweighted - eisclimber/ExPresS-XR GitHub Wiki
Method in RuntimeUtils
Returns a random element from an array using weighted distribution.
public static T GetRandomArrayElementWeighted<T>(T[] objects, float[] probabilities)| Name | Description |
|---|---|
T[] objects |
Objects to draw from. |
float[] probabilities |
Probabilities for each object. |
| Name | Description |
|---|---|
| T | Type of the object to draw. |
A random object from the array.