Files
wwdpublic/Content.Shared/Sound/Components/BaseEmitSoundComponent.cs
deltanedas faf671e169 add SpawnTableOnUse (#32620)
* add SpawnTableOnUse

* make BaseEmitSound more flexible and remove sound from spawntable

* add log

* :trollface:

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
(cherry picked from commit 2635888b6ae226f34b572175a3feb99d23a52881)
2025-09-27 12:21:16 +03:00

25 lines
720 B
C#

using Robust.Shared.Audio;
namespace Content.Shared.Sound.Components;
/// <summary>
/// Base sound emitter which defines most of the data fields.
/// Accepts both single sounds and sound collections.
/// </summary>
public abstract partial class BaseEmitSoundComponent : Component
{
public static readonly AudioParams DefaultParams = AudioParams.Default.WithVolume(-2f);
[AutoNetworkedField]
[ViewVariables(VVAccess.ReadWrite)]
[DataField(required: true)]
public SoundSpecifier? Sound;
/// <summary>
/// Play the sound at the position instead of parented to the source entity.
/// Useful if the entity is deleted after.
/// </summary>
[DataField]
public bool Positional;
}