Game.Prefabs.OverlayConfigurationData
Assembly: Assembly-CSharp (typical Unity/Game assembly)
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
OverlayConfigurationData is an empty/tag ECS component used to mark entities (or prefabs) that participate in or expose an overlay configuration. The struct is annotated with [StructLayout(LayoutKind.Sequential, Size = 1)] so it occupies 1 byte despite having no fields — this makes it suitable as a tag component in Unity's DOTS/ECS without being zero-sized. Implementing IComponentData makes it a component that can be attached to Entities, and IQueryTypeParameter allows it to be used in query type parameters in the ECS query APIs.
Fields
- None
This struct declares no fields — it is a marker/tag component. The StructLayout attribute sets an explicit size so it is stored as a concrete (1-byte) component.
Properties
- None
Constructors
public OverlayConfigurationData()
The default parameterless constructor is implicit. Because the struct contains no data, instances are effectively a marker.
Methods
- None
Usage Example
using Unity.Entities;
// Add the marker to an existing entity
entityManager.AddComponentData(entity, new OverlayConfigurationData());
// or
entityManager.AddComponent<OverlayConfigurationData>(entity);
// Querying for entities that have this overlay configuration tag
Entities
.WithAll<OverlayConfigurationData>()
.ForEach((Entity e) =>
{
// Handle entities that are overlay-configurable
})
.Schedule();
// Attach to a prefab/entity when creating an archetype/prefab
var archetype = entityManager.CreateArchetype(typeof(OverlayConfigurationData), /* other component types */);
var instance = entityManager.CreateEntity(archetype);
Notes: - This is intended as a lightweight marker; it carries no payload data. - The explicit Size = 1 ensures the component is non-zero-sized in storage (useful for some ECS behaviors and interoperability). - In modding contexts, add/remove this component on prefabs/entities to opt them into overlay-configuration systems.