Skip to content

Game.LaneDirectionData

Assembly: Game (may appear in Assembly-CSharp depending on build)
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType, implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
Represents the permitted directions for a lane within a prefab or lane entity. The struct stores separate direction flags/values for left, forward and right movements. It is an ECS component (IComponentData) that can be attached to lane entities and used in queries (IQueryTypeParameter) to filter or read lane direction settings.


Fields

  • public LaneDirectionType m_Left
    Represents the allowed left-turn direction state for the lane. Typically this will be an enum or flags type (LaneDirectionType) indicating whether left turns are permitted.

  • public LaneDirectionType m_Forward
    Represents the allowed forward (straight) direction state for the lane.

  • public LaneDirectionType m_Right
    Represents the allowed right-turn direction state for the lane.

Properties

  • (none)

Constructors

  • (implicit default struct constructor)
    Struct uses the default value-type constructor. Initialize fields explicitly when creating instances.

Methods

  • (none)

Usage Example

// Example: add the component to an entity representing a lane
var laneComponent = new LaneDirectionData
{
    m_Left = LaneDirectionType.None,      // example values — actual enum members may differ
    m_Forward = LaneDirectionType.Forward,
    m_Right = LaneDirectionType.Right
};

entityManager.AddComponentData(laneEntity, laneComponent);

// Example: read in a SystemBase (Entities.ForEach)
Entities
    .WithName("ReadLaneDirections")
    .ForEach((in LaneDirectionData laneDir) =>
    {
        // Inspect laneDir.m_Left / m_Forward / m_Right
    }).Schedule();

Notes: - LaneDirectionType is not defined in this file; it is expected to be an enum or flags type elsewhere in the codebase that encodes allowed turn directions. - Because this is an IComponentData struct, prefer using EntityManager or SystemBase (Entities.ForEach) APIs to add/read the component on entities.