Game.Prefabs.NetCompositionCrosswalk
Assembly: Game (in-game assembly)
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, Unity.Entities.IBufferElementData
Summary:
Represents a single crosswalk segment entry used in net (road) prefab composition. This buffer element associates a lane Entity with a start and end position for the crosswalk geometry and carries lane-related flags. Marked with [InternalBufferCapacity(0)] so the buffer has no inline storage and will allocate dynamically.
Fields
-
public Entity m_Lane
Reference to the lane entity that this crosswalk segment is associated with. This is an Entity handle (ECS entity) — typically the lane entity within the net prefab or instantiated network. -
public float3 m_Start
Start position of the crosswalk segment. This is a float3 (x,y,z). The coordinate space (local to the prefab or world) is not specified in the type definition; verify by inspecting the code path that populates this buffer in the game to determine whether positions are local or world-space. -
public float3 m_End
End position of the crosswalk segment. Same coordinate-space caveat as m_Start applies. -
public LaneFlags m_Flags
Lane-related flags for this crosswalk segment. LaneFlags is an enum/bitfield used elsewhere in the codebase to describe lane properties (direction, vehicle/pedestrian type, modifiers). Consult the LaneFlags definition for exact meanings of bits you may encounter or need to set.
Properties
- (none)
Constructors
- (implicit) default constructor
As a struct it has the default value-type constructor. No explicit constructors are defined.
Methods
- (none)
Usage Example
// Adding elements to the buffer (EntityManager API)
var buffer = entityManager.AddBuffer<Game.Prefabs.NetCompositionCrosswalk>(prefabEntity);
buffer.Add(new Game.Prefabs.NetCompositionCrosswalk {
m_Lane = laneEntity,
m_Start = new Unity.Mathematics.float3(0f, 0f, 0f),
m_End = new Unity.Mathematics.float3(1f, 0f, 0f),
m_Flags = (LaneFlags)0 // set appropriate flags
});
// Accessing in a SystemBase via DynamicBuffer
Entities
.ForEach((Entity e, DynamicBuffer<Game.Prefabs.NetCompositionCrosswalk> crosswalks) =>
{
for (int i = 0; i < crosswalks.Length; i++)
{
var cw = crosswalks[i];
// use cw.m_Lane, cw.m_Start, cw.m_End, cw.m_Flags
}
}).Schedule();