Game.Prefabs.CommercialCompanyData
Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
CommercialCompanyData is an empty marker/tag component used by the game's ECS (Unity.Entities) to mark or identify commercial company prefabs/entities. The struct is deliberately empty (no managed fields) but is annotated with a StructLayout attribute specifying Size = 1 so it has a non-zero size for interop/serialization reasons. Because it implements IComponentData and IQueryTypeParameter it can be attached to entities and used in ECS queries and query parameter APIs.
Fields
- This struct declares no instance fields.
Note: the type is attributed with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a non-zero size at the native layout level even though it carries no data.
Properties
- This type defines no properties.
Constructors
- The struct has the default parameterless constructor provided by C#. No custom constructors are declared.
Methods
- No methods are declared on this type.
Usage Example
// Add as a tag component when creating an entity
var archetype = entityManager.CreateArchetype(typeof(Game.Prefabs.CommercialCompanyData), /* other components */);
Entity companyEntity = entityManager.CreateEntity(archetype);
// Or add the component to an existing entity
entityManager.AddComponentData(companyEntity, new Game.Prefabs.CommercialCompanyData());
// Querying for entities with the tag (example in a SystemBase)
Entities
.WithAll<Game.Prefabs.CommercialCompanyData>()
.ForEach((Entity e /*, other params */) =>
{
// handle commercial company entities
})
.Schedule();
Additional notes: - Because this is a tag (marker) component it is typically used only for filtering or tagging entities; it carries no runtime data. - The StructLayout(Size = 1) is often used to avoid issues where zero-sized structs may behave inconsistently in some interop/serialization scenarios.