Game.Common.AudioEndBarrier
Assembly: Assembly-CSharp
Namespace: Game.Common
Type: class
Base: SafeCommandBufferSystem
Summary:
AudioEndBarrier is a small system type in the Game.Common namespace that derives from SafeCommandBufferSystem. It currently provides an override point for the system update step and includes preservation attributes so it won't be stripped by managed code optimization. As implemented, its OnUpdate override simply forwards to the base implementation and does not add additional behavior; it appears intended as a dedicated end-of-audio-frame barrier for scheduling or executing command buffers related to audio processing in the game's ECS pipeline.
Fields
- This class does not declare any private or public fields. {{ This class relies on its base type (SafeCommandBufferSystem) for any internal state. }}
Properties
- This class does not declare any properties. {{ Any properties or job handles would be provided by the SafeCommandBufferSystem base class. }}
Constructors
public AudioEndBarrier()
{{ The constructor is empty and marked with [Preserve], indicating it should not be removed by code-stripping. It performs no initialization beyond what the base constructor does. }}
Methods
protected override void OnUpdate() : System.Void
{{ The OnUpdate method is overridden and decorated with [MethodImpl(MethodImplOptions.NoInlining)] and [Preserve]. The implementation simply calls base.OnUpdate(), so all update behavior is currently handled by the SafeCommandBufferSystem base class. The NoInlining attribute prevents the JIT from inlining this method (useful for stack traces or certain runtime behaviors), and Preserve prevents the method from being stripped. This override provides a hook where audio-specific end-of-frame logic could be added in future. }}
Usage Example
// The AudioEndBarrier itself contains no additional logic beyond the base system.
// Typical usage is to let the system run as part of the game's systems or to subclass it
// if you need to inject audio-specific end-of-frame command buffer work.
[Preserve]
public class MyAudioProducerSystem : Unity.Entities.SystemBase
{
protected override void OnUpdate()
{
// produce or schedule audio-related commands here
// ...
}
}
// If you need to extend AudioEndBarrier:
public class CustomAudioEndBarrier : Game.Common.AudioEndBarrier
{
[MethodImpl(MethodImplOptions.NoInlining)]
[Preserve]
protected override void OnUpdate()
{
// run custom end-of-audio-frame logic before or after the base behavior
// e.g. flush audio command buffers, perform cleanups, etc.
// Call base to retain SafeCommandBufferSystem behavior
base.OnUpdate();
}
}