Description
The Fadeout
property of the SoundHandle
class represents the fadeout curve for when the sound stops. This property is of type Curve
, which allows you to define how the sound should gradually decrease in volume over time until it is completely silent.
Usage
To use the Fadeout
property, you can assign a Curve
object to it, which defines the fadeout behavior of the sound. This is useful for creating smooth transitions when stopping a sound.
Example
// Example of setting a fadeout curve for a sound
SoundHandle soundHandle = new SoundHandle();
Curve fadeoutCurve = new Curve();
// Define the fadeout curve
fadeoutCurve.AddKey(0.0f, 1.0f); // Start at full volume
fadeoutCurve.AddKey(1.0f, 0.0f); // Fade to silence over 1 second
// Assign the fadeout curve to the sound handle
soundHandle.Fadeout = fadeoutCurve;
// Later, when stopping the sound, the fadeout curve will be applied
soundHandle.Stop();