The SineEaseInOut
method provides a smooth transition effect using a sine wave function. This easing function is useful for animations where you want a gradual acceleration and deceleration, creating a natural and smooth motion.
The SineEaseInOut
method provides a smooth transition effect using a sine wave function. This easing function is useful for animations where you want a gradual acceleration and deceleration, creating a natural and smooth motion.
To use the SineEaseInOut
method, pass a single floating-point value f
that represents the normalized time (typically between 0.0 and 1.0) of the animation. The method returns a float
that represents the eased value at that point in time.
// Example usage of SineEaseInOut float startValue = 0.0f; float endValue = 1.0f; float time = 0.5f; // Halfway through the animation // Calculate the eased value float easedValue = Easing.SineEaseInOut(time); // Interpolate between start and end values using the eased value float interpolatedValue = startValue + (endValue - startValue) * easedValue; // interpolatedValue now holds the value at the eased position