@@ -237,7 +237,7 @@ public sealed class JukeboxSystem : EntitySystem
|
|||||||
|
|
||||||
private JukeboxAudio? TryCreateStream(JukeboxComponent jukeboxComponent, TransformComponent jukeboxXform, TransformComponent playerXform)
|
private JukeboxAudio? TryCreateStream(JukeboxComponent jukeboxComponent, TransformComponent jukeboxXform, TransformComponent playerXform)
|
||||||
{
|
{
|
||||||
if (jukeboxComponent.PlayingSongData == null) return null;
|
if (jukeboxComponent.PlayingSongData == null) return null!;
|
||||||
|
|
||||||
var resourcePath = jukeboxComponent.PlayingSongData.SongPath!;
|
var resourcePath = jukeboxComponent.PlayingSongData.SongPath!;
|
||||||
|
|
||||||
@@ -250,11 +250,13 @@ public sealed class JukeboxSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
var playingStream = _clydeAudio.CreateAudioSource(audio.AudioStream);
|
var playingStream = _clydeAudio.CreateAudioSource(audio.AudioStream);
|
||||||
|
|
||||||
if (playingStream == null)
|
if (playingStream == null)
|
||||||
return null!;
|
return null!;
|
||||||
|
|
||||||
playingStream.Volume = _jukeboxVolume;
|
playingStream.Volume = _jukeboxVolume;
|
||||||
playingStream.RolloffFactor = 3.5f;
|
playingStream.RolloffFactor = 3.5f;
|
||||||
|
playingStream.PlaybackPosition = jukeboxComponent.PlayingSongData.PlaybackPosition;
|
||||||
|
|
||||||
playingStream.Position = jukeboxXform.MapPosition.Position;
|
playingStream.Position = jukeboxXform.MapPosition.Position;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user