Description
The Duration
field specifies the length of time, in seconds, that a transition should take to move from the old value to the new value. This field is part of the TransitionDesc
struct, which is used to describe the transition of a single CSS property in the UI.
Usage
To use the Duration
field, you can set it to a nullable float value representing the duration in seconds. If the value is null
, the transition will not have a specified duration, and default behavior will apply.
Example
// Example of setting the Duration field in a TransitionDesc
TransitionDesc transition = new TransitionDesc();
transition.Duration = 0.5f; // Set the transition duration to 0.5 seconds
// Alternatively, you can set it to null if you want to use the default duration
transition.Duration = null;