SoundEvent SoundEvent { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

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

Usage

To use the SoundEvent property, you need to assign a SoundEvent object to it. This object defines the sound that will be played when the component is activated. You can set this property in the editor or programmatically in your code.

Example

// Example of setting the SoundEvent property

public class MySoundComponent : BaseSoundComponent
{
    public MySoundComponent()
    {
        // Assign a sound event to the SoundEvent property
        this.SoundEvent = new SoundEvent("path/to/sound");
    }

    public override void OnActivate()
    {
        // Start playing the sound when the component is activated
        StartSound();
    }
}