Sandbox.SoundEvent/SoundSelectionMode SelectionMode { get; set; }

robot_2Generated
code_blocksInput

Description

The SelectionMode property of the SoundEvent class specifies the strategy used to select a sound from a list of available sounds. This property is crucial when a sound event is associated with multiple sound files, allowing for different selection behaviors such as random or sequential selection.

Usage

To use the SelectionMode property, you need to set it to one of the available SoundSelectionMode enumeration values. This will determine how the sound event chooses which sound to play from its list of sounds.

For example, you might set the SelectionMode to SoundSelectionMode.Random to have a random sound selected each time the event is triggered.

Example

// Example of setting the SelectionMode property
SoundEvent mySoundEvent = new SoundEvent();
mySoundEvent.SelectionMode = SoundSelectionMode.Random;

// This will cause the sound event to randomly select a sound from its list
// each time it is played.