Random From Distributions: Statistical Distributions Random Number Generator

FREE
Publisher Nathan Daly
File size 77.36kB
Number of files 25
Latest version 2.0.0
Latest release date 2014-08-18 06:10:45
First release date 2014-03-10 07:56:19
Supported Unity versions 2018.4.2 or higher
Provides a series of functions to get a random number from various distributions. Unity's built-in Random.Range() provides random numbers from the Uniform Distribution, but this package gives the programmer more choices.


This package provides the ability to get a random number from:
- Normal Distribution
- Linear Distribution
- Exponential Distribution.
- Hockey Stick Curve Distribution (sec^2 distribution).
- Custom Discrete Probability Function.


For each distribution there are multiple options that describe the shape of the distribution the random numbers are pulled from.


The package adds a single script file, RandomFromDistribution, that contains all of these static functions.


It also contains example scenes that demonstrate these functions, allowing you to see how the different options affect each distribution.


Use these distributions to generate random objecst in a very large range, but clustered around the center (normal distribution). Or use it to specify spawning probabilities for different monsters based on their difficulties (custom discrete probability function). Or use it randomize a timer that is more likely to go off quickly but sometimes takes a while (linear, exponential, or hockey stick slope distributions). There are lots of possibilities to play with!