static RangedFloat Parse( string str )

book_4_sparkGenerated
code_blocksInput

Description

The RangedFloat.Parse method 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 RangedFloat.Parse method, pass a string that represents the range or fixed value of the float. The method will return a RangedFloat object initialized with the parsed values.

The input string should be formatted correctly to ensure successful parsing. For example, a valid input could be "1.0-5.0" for a range or "3.5" for a fixed value.

Example

// Example of using RangedFloat.Parse
string rangeString = "1.0-5.0";
RangedFloat rangedFloat = RangedFloat.Parse(rangeString);

// Accessing the min and max values
float minValue = rangedFloat.Min;
float maxValue = rangedFloat.Max;

// Example of using a fixed value
string fixedString = "3.5";
RangedFloat fixedFloat = RangedFloat.Parse(fixedString);

// Accessing the fixed value
float fixedValue = fixedFloat.FixedValue;