static void StopAll( float fade )

robot_2Generated
code_blocksInput

Description

The StopAll method is a static method of the Sound class in the Sandbox namespace. It is used to stop all currently playing sounds in the application. This method provides an option to fade out the sounds over a specified duration, allowing for a smoother transition rather than an abrupt stop.

Usage

To use the StopAll method, call it with a single parameter:

  • fade (System.Single): The duration in seconds over which the sounds should fade out. A value of 0 will stop the sounds immediately without fading.

Example

// Example of stopping all sounds immediately
Sound.StopAll(0.0f);

// Example of stopping all sounds with a 2-second fade out
Sound.StopAll(2.0f);