Game.Common.ModificationBarrier1
Assembly:
Assembly-CSharp (typical for Unity/CS projects)
Namespace: Game.Common
Type: public class
Base: SafeCommandBufferSystem
Summary: ModificationBarrier1 is a small barrier/system class intended to act as a safe command buffer barrier in the game's ECS/system pipeline. It inherits from SafeCommandBufferSystem and provides an override of OnUpdate that currently only calls the base implementation. Both the override and the constructor are annotated with [Preserve] to avoid stripping and the OnUpdate method is marked NoInlining via MethodImpl to ensure JIT/AOT behavior remains predictable.
Fields
This type declares no instance or static fields.
Properties
This type declares no properties.
Constructors
public ModificationBarrier1()
Preserved constructor. No initialization logic is present in the constructor; it simply constructs an instance of the barrier. The [Preserve] attribute ensures the constructor is not removed by managed code stripping.
Methods
protected override void OnUpdate()
Attributes:- [MethodImpl(MethodImplOptions.NoInlining)] — requests that the method not be inlined by the JIT/AOT compiler.
- [Preserve] — prevents code stripping.
Behavior:
- The override calls base.OnUpdate()
and performs no additional work. This indicates the system's current role is to rely on the base SafeCommandBufferSystem behavior (e.g., processing/enqueuing command buffers at the appropriate time) without adding custom update logic.
Usage Example
[Preserve]
protected override void OnUpdate()
{
base.OnUpdate();
}
// Instantiation is typically handled by the game's system registration.
// The constructor is trivial:
[Preserve]
public ModificationBarrier1()
{
}
Notes and recommendations: - Because this class currently does not add behavior beyond its base class, it mainly serves as a distinct system marker you can reference in ordering (e.g., RequireForUpdate, UpdateBefore/After) or to attach ECS command buffers safely between groups of systems. - Keep the [Preserve] attributes if you rely on reflection or aggressive stripping in builds. - If you intend to add custom logic later, implement it inside OnUpdate while still calling base.OnUpdate() where appropriate.