Skip to content

Game.Prefabs.PipelineData

Assembly: Game
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable

Summary:
PipelineData is an empty, serializable marker component used with the Unity Entities (ECS) systems in Cities: Skylines 2. It carries no payload (the struct is deliberately empty) and exists to tag or identify entities for pipeline-related logic (for example, to mark entities that participate in a specific prefab/processing pipeline). The struct is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure it has a non-zero size for the game's serialization system and to satisfy requirements of IEmptySerializable.


Fields

  • None
    This struct contains no instance fields. The StructLayout attribute with Size = 1 ensures the type occupies at least one byte for serialization purposes.

Properties

  • None

Constructors

  • public PipelineData() (implicit)
    No custom constructors are defined. Use the default parameterless constructor (implicitly provided for structs) when creating instances.

Methods

  • None
    No methods are declared. Behavior is provided via the ECS systems and by the implemented interfaces.

Notes on implemented interfaces: - IComponentData: Marks the type as a Unity ECS component that can be attached to entities. - IQueryTypeParameter: Allows the type to be used in query-related contexts (e.g., as part of query definitions). - IEmptySerializable: Integration with Colossal's serialization system to ensure the presence/absence of this empty tag can be serialized and deserialized correctly.

Usage Example

using Unity.Entities;
using Unity.Collections;
using Game.Prefabs;

// Create an entity with the PipelineData tag
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var archetype = entityManager.CreateArchetype(typeof(PipelineData));
Entity e = entityManager.CreateEntity(archetype);

// Or add the tag to an existing entity
entityManager.AddComponentData(e, new PipelineData());

// Query for entities that have the PipelineData tag
var query = entityManager.CreateEntityQuery(ComponentType.ReadOnly<PipelineData>());
using (var entities = query.ToEntityArray(Allocator.TempJob))
{
    foreach (var ent in entities)
    {
        // process pipeline-tagged entities
    }
}

Additional information: - Because PipelineData is an empty tag type, it is typically used only to mark or filter entities. Any pipeline-specific data should be placed in separate components. - The StructLayout(Size = 1) pattern is common for empty, serializable marker components in games that require a non-zero size for their custom serializers.