void StopAllSounds( float fadeOutTime )

robot_2Generated
code_blocksInput

Description

The StopAllSounds method stops all sounds currently playing on the GameObject. This method allows you to specify a fade-out time, which will gradually reduce the volume of the sounds to zero over the specified duration before stopping them completely.

Usage

To use the StopAllSounds method, call it on an instance of a GameObject and provide a fadeOutTime parameter. The fadeOutTime is a float value representing the duration in seconds over which the sounds should fade out.

Example

// Example of stopping all sounds on a GameObject with a fade-out time of 2 seconds
GameObject myGameObject = new GameObject();
myGameObject.StopAllSounds(2.0f);