float Max { get; set; }

robot_2Generated
code_blocksInput

Description

The Max property represents the maximum value of the float range in a RangedFloat structure. This property is used to define the upper limit of the range. In cases where the RangedFloat is of type RangeType.Fixed, the Max value will be the same as the Min value, indicating a fixed value rather than a range.

Usage

Use the Max property to set or retrieve the maximum value of a RangedFloat. This is particularly useful when you need to define a range for randomization or when you want to ensure a value does not exceed a certain limit.

Example

// Example of using RangedFloat with Max property
RangedFloat rangedValue = new RangedFloat();
rangedValue.Min = 1.0f;
rangedValue.Max = 5.0f;

// Accessing the Max property
float maxValue = rangedValue.Max;

// Output the max value
// maxValue should be 5.0f in this case

// Example of setting a fixed value
rangedValue.FixedValue = 3.0f;
// Now, rangedValue.Max and rangedValue.Min will both be 3.0f