getrandomarrayelement 2 - eisclimber/ExPresS-XR GitHub Wiki
Method in RuntimeUtils
Return a random element from the first array given the probabilities for each object. If a linear or weighted distribution should be used, is decided by the useWeighted value.
public static T GetRandomArrayElement<T>(T[] objects, bool useWeighted, float[] probabilities = null)| Name | Description |
|---|---|
T[] objects |
Objects to draw from. |
bool useWeighted |
Whether or not weighted random should be used. |
float[] probabilities |
Probabilities for each object. |
| Name | Description |
|---|---|
| T | Type of the object to draw. |
A random object from the array.