Game.Prefabs.ResearchFacilityData
Assembly: Assembly-CSharp (game assembly)
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
ResearchFacilityData is a zero/near-zero-sized marker component used to tag entities that represent research facility prefabs. The type is declared with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a defined size for serialization/interop. It implements Unity.Entities.IComponentData so it can be attached to ECS entities, IQueryTypeParameter to be used in queries, and Colossal.Serialization.Entities.IEmptySerializable to indicate it has no serializable fields handled by the game's serializer. The struct contains no fields or methods; it serves purely as a tag/marker.
Fields
- None — ResearchFacilityData declares no instance fields. The explicit StructLayout(Size = 1) gives it a small nonzero size for serialization/interop reasons.
Properties
- None.
Constructors
- Implicit default struct constructor. You can construct it with
new ResearchFacilityData()
or use the default literaldefault(ResearchFacilityData)
.
Methods
- None — there are no methods implemented on this struct. Serialization and query behavior are governed by the marker interfaces it implements.
Usage Example
// Add the tag component to an entity
var tag = new ResearchFacilityData();
entityManager.AddComponentData(entity, tag);
// Check whether an entity has the tag
if (entityManager.HasComponent<ResearchFacilityData>(entity))
{
// entity is a research facility
}
// Query all entities that are research facilities
Entities
.WithAll<ResearchFacilityData>()
.ForEach((Entity entity) =>
{
// Process research facility entity
})
.Schedule();