1
0

BaseEmitSoundComponent.cs 720 B

123456789101112131415161718192021222324
  1. using Robust.Shared.Audio;
  2. namespace Content.Shared.Sound.Components;
  3. /// <summary>
  4. /// Base sound emitter which defines most of the data fields.
  5. /// Accepts both single sounds and sound collections.
  6. /// </summary>
  7. public abstract partial class BaseEmitSoundComponent : Component
  8. {
  9. public static readonly AudioParams DefaultParams = AudioParams.Default.WithVolume(-2f);
  10. [AutoNetworkedField]
  11. [ViewVariables(VVAccess.ReadWrite)]
  12. [DataField(required: true)]
  13. public SoundSpecifier? Sound;
  14. /// <summary>
  15. /// Play the sound at the position instead of parented to the source entity.
  16. /// Useful if the entity is deleted after.
  17. /// </summary>
  18. [DataField]
  19. public bool Positional;
  20. }