Add ambient music (#16829)
This commit is contained in:
@@ -11,6 +11,7 @@ using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
using System.Linq;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
namespace Content.Client.Audio
|
||||
{
|
||||
@@ -106,7 +107,19 @@ namespace Content.Client.Audio
|
||||
_playingCount.Remove(sound.Sound);
|
||||
}
|
||||
|
||||
private void SetAmbienceVolume(float value) => _ambienceVolume = value;
|
||||
private void SetAmbienceVolume(float value)
|
||||
{
|
||||
_ambienceVolume = value;
|
||||
|
||||
foreach (var (comp, values) in _playingSounds)
|
||||
{
|
||||
if (values.Stream == null)
|
||||
continue;
|
||||
|
||||
var stream = (AudioSystem.PlayingStream) values.Stream;
|
||||
stream.Volume = _params.Volume + comp.Volume + _ambienceVolume;
|
||||
}
|
||||
}
|
||||
private void SetCooldown(float value) => _cooldown = value;
|
||||
private void SetAmbientCount(int value) => _maxAmbientCount = value;
|
||||
private void SetAmbientRange(float value) => _maxAmbientRange = value;
|
||||
|
||||
Reference in New Issue
Block a user