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 you want to convert into a RangedFloat object. The string should be formatted correctly to ensure successful parsing.

Example formats include:

  • "1.0-5.0" for a range from 1.0 to 5.0.
  • "3.5" for a fixed value of 3.5.

Example

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

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

// Accessing properties
float minValue = rangedFloat.Min;
float maxValue = rangedFloat.Max;
float fixedValue = fixedFloat.FixedValue;