Skip to content

Game.Prefabs.BuildingModuleData

Assembly:
Assembly-CSharp

Namespace:
Game.Prefabs

Type:
struct

Base:
IComponentData, IQueryTypeParameter

Summary:
An empty/tag component used by the ECS to mark entities as "building module" prefabs or parts. The StructLayout attribute with Size = 1 ensures the struct has a non-zero size (useful for native interop and some ECS memory/layout expectations) while keeping it effectively empty for logic. Implementing IQueryTypeParameter allows the type to be used directly in entity queries and query filters.


Fields

  • This type defines no instance fields. The StructLayout(Size = 1) attribute gives the struct a fixed size of 1 byte despite having no fields.

Properties

  • This type defines no properties.

Constructors

  • public BuildingModuleData() (implicit)
    The default value-type constructor is used. No custom constructor is defined.

Methods

  • This type defines no methods.

Usage Example

// Add the tag/component to an entity
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity someEntity = /* obtain or create entity */;
entityManager.AddComponentData(someEntity, new Game.Prefabs.BuildingModuleData());

// Query for entities that are building modules in a SystemBase
protected override void OnUpdate()
{
    Entities
        .WithAll<Game.Prefabs.BuildingModuleData>()
        .ForEach((Entity entity) =>
        {
            // process building module entity
        })
        .WithoutBurst()
        .Run();
}

Notes: - Because this is a marker component (no payload), use it to tag entities for filtering or conditional processing. - The StructLayout attribute ensures a deterministic small size for native layout and may affect memory layout/interop expectations when interacting with low-level APIs.