Game.Prefabs.AuxiliaryNetLane
Assembly:
Assembly-CSharp (inferred)
Namespace: Game.Prefabs
Type:
public struct AuxiliaryNetLane : IBufferElementData
Base:
Unity.Entities.IBufferElementData (struct implementing the interface)
Summary:
Represents a single auxiliary lane entry used as a dynamic buffer element on an entity (e.g., a network prefab or segment entity). Each element stores a reference to a lane prefab (Entity) and placement information (position and spacing) plus bitflag fields describing composition requirements and lane characteristics. The attribute [InternalBufferCapacity(0)] indicates no inline storage; the buffer will be allocated dynamically. This struct is intended for use with DynamicBuffer
Fields
-
public Entity m_Prefab
Reference to the lane prefab (an Entity) that should be used/instantiated for this auxiliary lane entry. -
public float3 m_Position
Local position offset for the lane relative to the owning entity or anchor. Uses Unity.Mathematics.float3. -
public float3 m_Spacing
Spacing vector that can be used to offset or space repeated lane instances (e.g., lateral offset between repeated lanes). -
public CompositionFlags m_CompositionAll
Bitflags requiring all of the specified composition conditions to be present for this lane to be applicable. (CompositionFlags is a bitmask enum used by the game to express composition/condition requirements.) -
public CompositionFlags m_CompositionAny
Bitflags where any matching bit makes the lane applicable. -
public CompositionFlags m_CompositionNone
Bitflags that must be absent for this lane to be applicable. -
public LaneFlags m_Flags
Bitflags describing lane-specific properties (direction, type, AI behavior hints, or other lane traits). (LaneFlags is a bitmask enum.)
Notes: CompositionFlags and LaneFlags are game-defined enums/bitmasks — consult their definitions for exact meanings.
Properties
- None (this is a plain data struct with public fields; no properties are defined)
Constructors
public AuxiliaryNetLane()
Implicit default (parameterless) struct constructor is available. No explicit constructors are defined in the source.
Methods
- None (no instance or static methods are defined on this struct)
Usage Example
// Example usage inside a SystemBase or other ECS code:
// - Add a DynamicBuffer<AuxiliaryNetLane> to an entity (e.g., a network prefab entity)
// - Populate it with one or more elements describing auxiliary lanes.
using Unity.Entities;
using Unity.Mathematics;
using Game.Prefabs;
public partial class ExampleSystem : SystemBase
{
protected override void OnCreate()
{
base.OnCreate();
// (Optionally) create or obtain an entity that represents a network prefab.
}
protected override void OnUpdate()
{
var em = EntityManager;
// Create an entity for demo purposes
var entity = em.CreateEntity();
// Add the dynamic buffer component
var buffer = em.AddBuffer<AuxiliaryNetLane>(entity);
// Add an entry
buffer.Add(new AuxiliaryNetLane
{
m_Prefab = /* some Entity lane prefab reference */,
m_Position = new float3(0f, 0f, 0f),
m_Spacing = new float3(3.5f, 0f, 0f),
m_CompositionAll = CompositionFlags.None,
m_CompositionAny = CompositionFlags.None,
m_CompositionNone = CompositionFlags.None,
m_Flags = LaneFlags.None
});
// Iterate later:
foreach (var lane in em.GetBuffer<AuxiliaryNetLane>(entity))
{
// Use lane.m_Prefab, lane.m_Position, etc.
}
}
}
Additional notes: - Because InternalBufferCapacity is 0, buffers start empty and are stored externally — expect allocation when elements are added. - This struct is plain data suitable for serialization and Burst/JOB usage where allowed by the referenced types. - Ensure that references stored in m_Prefab are valid Entity prefab references (archetyped as instantiable prefabs) before instantiation.