Game.Prefabs.UIStatisticsCategoryData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
UIStatisticsCategoryData is an empty marker component (value type) used with Unity's ECS to tag entities or prefabs that represent a UI statistics category. The struct is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to force a 1-byte size (common pattern for marker components to ensure a non-zero size and stable memory layout). It implements IComponentData so it can be attached to entities and IQueryTypeParameter to be usable in query-type contexts.
Fields
- None (the struct declares no instance fields)
The type is explicitly sized to 1 byte via the StructLayout attribute; there are no managed fields defined in code.
Properties
- None
Constructors
public UIStatisticsCategoryData()
(implicit default constructor)
The struct uses the default parameterless constructor provided by the runtime. You can create an instance withnew UIStatisticsCategoryData()
when adding the component.
Methods
- None (no methods are declared)
No custom methods or overrides are provided by this type.
Usage Example
// Tag an entity as a UI statistics category:
entityManager.AddComponentData(entity, new UIStatisticsCategoryData());
// Query all entities tagged with the marker:
var query = entityManager.CreateEntityQuery(ComponentType.ReadOnly<UIStatisticsCategoryData>());
// or in a SystemBase job:
Entities.WithAll<UIStatisticsCategoryData>().ForEach((Entity e) =>
{
// handle UI statistics category entity
}).Schedule();
{{ Additional info: - Purpose: Marker components like this are commonly used to identify or group entities without storing extra data. - Memory/layout: The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute ensures a stable 1-byte footprint which can be important for blob/serialization constraints or to avoid zero-sized types in some ECS systems. - Compatibility: Works with Unity.Entities (DOTS) patterns — add/remove as a component, use in queries, or as a query-type parameter. }}