Game.Prefabs.PedestrianLaneData
Assembly: Game (assembly that contains game prefabs and ECS components; often Assembly-CSharp or a game-specific assembly)
Namespace: Game.Prefabs
Type: struct (value type)
Base: System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
PedestrianLaneData is an empty (marker) component used by the Entity Component System to mark entities that represent pedestrian lanes. The struct is laid out with a fixed size of 1 byte ([StructLayout(LayoutKind.Sequential, Size = 1)]) so it consumes minimal memory while allowing systems and queries to identify pedestrian-lane entities. Because it implements IComponentData, it can be attached to entities; implementing IQueryTypeParameter enables use in query APIs (e.g., WithAll
Fields
N/A
This struct declares no instance fields. The explicit struct layout with Size = 1 prevents the size from being zero while keeping the type effectively empty.
Properties
N/A
There are no properties on this type.
Constructors
public PedestrianLaneData()
The compiler-provided parameterless constructor initializes the value-type. No explicit constructors are defined.
Methods
N/A
There are no methods defined on this type.
Usage Example
// Add the marker component to an existing entity
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
// Given an entity that represents a lane
Entity laneEntity = /* obtain or create entity */;
// Add tag to mark it as a pedestrian lane
if (!entityManager.HasComponent<PedestrianLaneData>(laneEntity))
{
entityManager.AddComponent<PedestrianLaneData>(laneEntity);
}
// Query for all pedestrian lanes in a system
var query = entityManager.CreateEntityQuery(typeof(PedestrianLaneData), typeof(SomeOtherComponent));
using var entities = query.ToEntityArray(Allocator.TempJob);
foreach (var e in entities)
{
// handle pedestrian lane entity
}
Notes and guidance: - Use this component when you need to distinguish pedestrian lanes from other lane types in systems and EntityQueries. - Because it is a marker component, do not attempt to store mutable state on it — attach other components for per-entity data. - The small fixed size helps reduce memory overhead for large numbers of tagged entities.