Skip to content

Game.Prefabs.ConnectionLaneData

Assembly: Assembly-CSharp (Game project)
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType, IComponentData, IQueryTypeParameter

Summary:
ConnectionLaneData is an empty (marker/tag) ECS component used to mark entities that represent a connection lane prefab/element in the game's ECS. It is annotated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure it has a non-zero size (1 byte) and is blittable, which is important for Unity's DOTS runtime and native interop. Implementing IQueryTypeParameter makes it convenient to use this type directly in entity queries and job filtering. This struct contains no data — presence/absence on an entity is the meaningful information.


Fields

  • This struct defines no instance fields.
    ConnectionLaneData is a marker/tag component; all state is represented by presence on an entity rather than stored fields.

Properties

  • This struct exposes no properties.

Constructors

  • public ConnectionLaneData()
    This struct relies on the default parameterless constructor generated by C#. No explicit constructors are declared.

Methods

  • This struct declares no methods.

Usage Example

// Add the tag component to an entity
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity laneEntity = entityManager.CreateEntity();
entityManager.AddComponentData(laneEntity, new ConnectionLaneData());

// Query for all entities that have this tag
Entities.WithAll<ConnectionLaneData>().ForEach((Entity e) =>
{
    // process connection lane entities
}).Schedule();

// Remove the tag when no longer needed
entityManager.RemoveComponent<ConnectionLaneData>(laneEntity);

{{ Notes: - Use ConnectionLaneData as a lightweight tag for filtering and grouping connection-lane-related entities in systems. - The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute prevents the struct from being zero-sized, which avoids certain issues with native memory layout and some DOTS APIs that expect non-zero-sized components. - Because it implements IComponentData, it can be used with all standard ECS APIs (AddComponentData, RemoveComponent, WithAll etc.). }}