Skip to content

Game.Prefabs.ProcessingCompanyData

Assembly: Assembly-CSharp (inferred)
Namespace: Game.Prefabs

Type: struct

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

Summary:
Lightweight marker (tag) component used to identify entities that represent a "processing company" prefab in the game's ECS. The struct is deliberately empty and decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure it has a non-zero size at runtime (avoiding some problems that can arise with zero-sized types in certain interop or memory layouts). Because it implements IComponentData it can be attached to entities; IQueryTypeParameter allows it to be used in ECS query type parameters.


Fields

  • (none)
    This struct contains no fields. The meaningful aspect is the presence of the component as a tag and the StructLayout attribute that forces a size of 1.

Properties

  • (none)

Constructors

  • public ProcessingCompanyData()
    Struct has the implicit default constructor (no explicit constructors are defined). Use the default instance to add the tag to an entity.

Methods

  • (none)

Usage Example

// Tag an entity as a processing company:
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity companyEntity = em.CreateEntity(typeof(Game.Prefabs.ProcessingCompanyData));

// Or add the tag to an existing entity:
em.AddComponentData(existingEntity, new Game.Prefabs.ProcessingCompanyData());

// Query for entities with the tag:
Entities
    .WithAll<Game.Prefabs.ProcessingCompanyData>()
    .ForEach((Entity e) =>
    {
        // process processing-company entities
    }).Schedule();