Description
Returns the final value of this RangedFloat
, randomizing between the minimum and maximum values defined by the Min
and Max
properties. This method is useful when you want to obtain a float value that is within a specified range, potentially introducing variability in scenarios such as procedural generation or randomized gameplay elements.
Usage
To use the GetValue
method, simply call it on an instance of RangedFloat
. Ensure that the Min
and Max
properties are set to define the range from which the value will be randomized.
Example
// Example of using RangedFloat.GetValue
RangedFloat rangedFloat = new RangedFloat { Min = 1.0f, Max = 5.0f };
float randomValue = rangedFloat.GetValue();
// randomValue will be a float between 1.0 and 5.0