Also includes some (non critical) changes to the solution file to re-organize the Roslyn components.
24 lines
842 B
C#
24 lines
842 B
C#
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
namespace Content.Shared.Sound.Components;
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
|
public sealed partial class EmitSoundOnCollideComponent : BaseEmitSoundComponent
|
|
{
|
|
public static readonly TimeSpan CollideCooldown = TimeSpan.FromSeconds(0.2);
|
|
|
|
/// <summary>
|
|
/// Minimum velocity required for the sound to play.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("minVelocity")]
|
|
public float MinimumVelocity = 3f;
|
|
|
|
/// <summary>
|
|
/// To avoid sound spam add a cooldown to it.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("nextSound", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
[AutoPausedField]
|
|
public TimeSpan NextSound;
|
|
}
|