Description
The Parse
method of the RangedFloat
struct is a static method that converts a string representation of a ranged float into a RangedFloat
object. This method is useful for parsing strings that define a range of float values, typically in a format like "min-max" or a single fixed value.
Usage
To use the Parse
method, call it with a string that represents a ranged float. The string should be in a format that the method can interpret, such as "1.0-5.0" for a range or "3.5" for a fixed value. The method will return a RangedFloat
object initialized with the parsed values.
Example
// Example of using RangedFloat.Parse
string rangeString = "1.0-5.0";
RangedFloat rangedFloat = RangedFloat.Parse(rangeString);
// Example of using RangedFloat.Parse with a fixed value
string fixedString = "3.5";
RangedFloat fixedFloat = RangedFloat.Parse(fixedString);
// Accessing properties
float minValue = rangedFloat.Min;
float maxValue = rangedFloat.Max;
float fixedValue = fixedFloat.FixedValue;