The Stop
method is used to stop a sound that is currently playing. This method allows you to specify a fade-out time, which will gradually reduce the volume of the sound to zero over the specified duration before stopping it completely.
The Stop
method is used to stop a sound that is currently playing. This method allows you to specify a fade-out time, which will gradually reduce the volume of the sound to zero over the specified duration before stopping it completely.
To stop a sound using the Stop
method, you need to call it on an instance of SoundHandle
. You must provide a fadeTime
parameter, which is a float
representing the duration in seconds over which the sound should fade out before stopping.
// Assuming 'soundHandle' is an instance of SoundHandle float fadeOutDuration = 2.0f; // 2 seconds fade out soundHandle.Stop(fadeOutDuration);