Skip to content

Game.Prefabs.UIResourceCategoryData

Assembly:
Assembly-CSharp (typical game assembly; exact assembly may vary by project)

Namespace:
Game.Prefabs

Type:
struct

Base:
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
UIResourceCategoryData is an empty/tag component used by the ECS to mark entities (typically prefabs) that represent a UI resource category. The struct is explicitly given a sequential layout with Size = 1 so it occupies a minimal amount of memory while still being usable as a component/tag. It is used as a marker for queries and to identify entities that belong to the UI resource category system.


Fields

  • This struct declares no instance fields; it is an empty/tag component.
    Used purely as a marker type; storage footprint is minimized via [StructLayout(LayoutKind.Sequential, Size = 1)].

Properties

  • None. (The type does not expose any properties.)

Constructors

  • The type uses the implicit parameterless constructor provided by C# for value types.
    No custom constructors are declared.

Methods

  • None. (No methods are declared on this type.)

Usage Example

using Unity.Entities;
using Game.Prefabs;

// Adding the tag to an existing entity
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity someEntity = /* obtain or create entity */;
entityManager.AddComponentData(someEntity, new UIResourceCategoryData());

// Alternatively, create an archetype that includes the tag:
var archetype = entityManager.CreateArchetype(typeof(UIResourceCategoryData), /* other components */);
Entity taggedEntity = entityManager.CreateEntity(archetype);

Notes: - Because this type implements IQueryTypeParameter, it can be used directly in query definitions to filter or match entities that have this marker component. - The StructLayout attribute with Size = 1 ensures the component is very small and suitable as a tag without extra data.