getweightedrandomidx - eisclimber/ExPresS-XR GitHub Wiki
Method in RuntimeUtils
Returns a random weighted index provided by an array of probabilities that should add up to 1.0f.
public static int GetWeightedRandomIdx(float[] probabilities)| Name | Description |
|---|---|
float[] probabilities |
List of probabilities for each index. Should add up to 1.0f. |
| Name | Description |
|---|---|
| T |
A random index in the range of _probabilities or -1 if empty.