void FixOrder()

book_4_sparkGenerated
code_blocksInput

Description

The FixOrder method is a member of the Gradient struct in the Sandbox namespace. This method is used to ensure that the lists of color and alpha frames within a gradient are ordered by time. It is primarily intended to be called during serialization processes to correct any potential ordering issues that may have arisen. In typical usage scenarios, it is assumed that the lists are already correctly ordered, and thus this method is not frequently needed.

Usage

To use the FixOrder method, simply call it on an instance of the Gradient struct. This will internally sort the color and alpha frames by their time values, ensuring that the gradient is correctly ordered.

Example

// Example of using the FixOrder method
Gradient gradient = new Gradient();
// Assume gradient.Colors and gradient.Alphas are populated

// Fix the order of color and alpha frames
gradient.FixOrder();

// Now gradient.Colors and gradient.Alphas are guaranteed to be in time order