Skip to content

Game.Prefabs.BulldozeData

Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType, IComponentData, IQueryTypeParameter

Summary:
BulldozeData is an empty "tag" component used with Unity's DOTS/ECS to mark entities that are scheduled for bulldozing (demolition) or to classify entities for systems that handle bulldoze logic. The type is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] so it occupies 1 byte instead of being a zero-sized type — this makes it safe and predictable when used in native containers, interop, and job code. It implements IComponentData so it can be attached to ECS entities, and IQueryTypeParameter to be used conveniently in queries.


Fields

  • This component defines no instance fields. The StructLayout attribute sets the size to 1 byte to avoid zero-sized-struct issues and to ensure stable layout when used in native contexts.

Properties

  • This type defines no properties.

Constructors

  • public BulldozeData()
    The implicit default struct constructor initializes the component (no data). Because the struct is empty, default construction simply yields a tag value; the explicit size attribute ensures it still occupies memory.

Methods

  • This type defines no methods.

Usage Example

// Create an entity and add the BulldozeData tag to mark it for bulldozing
Entity entity = entityManager.CreateEntity();
entityManager.AddComponentData(entity, new BulldozeData());

// Query all entities marked for bulldoze in a system
Entities
    .WithAll<BulldozeData>()
    .ForEach((Entity e, in SomeOtherComponent comp) =>
    {
        // perform bulldoze processing (scheduling, removing, effects, etc.)
    }).Schedule();

Additional notes: - Use this component as a lightweight marker/tag that systems can check for or remove after processing. - The explicit 1-byte size makes the component safe to use across jobs and native collections where zero-sized components can cause problems.