prerelease
This commit is contained in:
@@ -4,7 +4,8 @@ using VeloX.Audio;
|
||||
|
||||
namespace VeloX;
|
||||
|
||||
[GameResource( "Engine Stream", "engstr", "Engine Sound", Category = "VeloX", Icon = "time_to_leave" )]
|
||||
[AssetType( Name = "Engine Stream", Extension = "engstr", Category = "VeloX" )]
|
||||
[Icon( "time_to_leave" )]
|
||||
public sealed class EngineStream : GameResource
|
||||
{
|
||||
public sealed class Layer
|
||||
|
||||
@@ -26,6 +26,7 @@ public class EngineStreamPlayer( EngineStream stream ) : IDisposable
|
||||
|
||||
public void Update( float deltaTime, Vector3 position, bool isLocal = false )
|
||||
{
|
||||
|
||||
var globalPitch = 1.0f;
|
||||
|
||||
// Gear wobble effect
|
||||
@@ -50,14 +51,14 @@ public class EngineStreamPlayer( EngineStream stream ) : IDisposable
|
||||
foreach ( var (id, layer) in Stream.Layers )
|
||||
{
|
||||
EngineSounds.TryGetValue( layer, out var channel );
|
||||
|
||||
if ( !channel.IsValid() )
|
||||
|
||||
if ( !channel.IsValid() && layer.AudioPath.IsValid() )
|
||||
{
|
||||
channel = Sound.PlayFile( layer.AudioPath );
|
||||
EngineSounds[layer] = channel;
|
||||
}
|
||||
|
||||
if ( channel.Paused && (EngineSoundPaused || layer.IsMuted) )
|
||||
if ( !channel.IsValid() || channel.Paused && (EngineSoundPaused || layer.IsMuted) )
|
||||
continue;
|
||||
|
||||
// Reset controller outputs
|
||||
|
||||
Reference in New Issue
Block a user