The Fadeout
property of the SoundHandle
class represents the fadeout curve used when a sound stops playing. This curve defines how the sound's volume decreases over time until it is completely silent.
The Fadeout
property of the SoundHandle
class represents the fadeout curve used when a sound stops playing. This curve defines how the sound's volume decreases over time until it is completely silent.
To use the Fadeout
property, you can assign a Curve
object to it, which specifies the desired fadeout behavior. This is useful for creating smooth transitions when stopping a sound.
// Example of setting a fadeout curve for a sound SoundHandle soundHandle = new SoundHandle(); Curve fadeoutCurve = new Curve(); // Configure the fadeout curve as needed 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; // Stop the sound with the fadeout effect soundHandle.Stop(1.0f); // 1 second fadeout duration