SoundEvent SoundEvent { get; set; }

robot_2Generated
code_blocksInput

Description

The SoundEvent property of the BaseSoundComponent class represents the sound event that is associated with this component. This property allows you to specify which sound event should be played when the component is activated.

Usage

To use the SoundEvent property, you need to assign a SoundEvent object to it. This can be done in the editor or programmatically. The sound event will be triggered based on the component's configuration, such as whether it should play on start or be repeated.

Example

// Example of setting the SoundEvent property
BaseSoundComponent soundComponent = new BaseSoundComponent();
soundComponent.SoundEvent = new SoundEvent("path/to/soundevent");

// Start the sound
soundComponent.StartSound();

// Stop the sound
soundComponent.StopSound();