getvalue01stepped - eisclimber/ExPresS-XR GitHub Wiki

RuntimeUtils.GetValue01Stepped(float,int,RoundType)

Method in RuntimeUtils

Summary

Steps a value on a range between [0.0f, 1.0f] to the closest of even numSteps intervals including the borders 0.0f and 1.0f. If numSteps is less than 1, the value will only be clamped between 0.0f and 1.0f.

public static float GetValue01Stepped(float value, int numSteps, RoundType roundType = RoundType.Round)

Parameters

Name Description
float value Value to be stepped.
int numSteps Number of intermediate steps.
ExPresSXR.Misc.RuntimeUtils.RoundType roundType How the number is rounded towards a step.

Returns

Value in range [0.0f, 1.0f] stepped to the closest value.

⚠️ **GitHub.com Fallback** ⚠️