Skip to content

Game.Prefabs.UIAssetCategoryData

Assembly:
Assembly-CSharp (game/mod assembly)

Namespace:
Game.Prefabs

Type:
struct

Base:
System.ValueType (implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter)

Summary:
UIAssetCategoryData is a lightweight ECS component used to associate a UI "category" entity with a menu entity. It is a value-type component (struct) that stores a single Entity reference (m_Menu). Because it implements IComponentData it can be added to entities via the Unity DOTS EntityManager, and implementing IQueryTypeParameter makes it usable as a parameter type in certain query APIs.


Fields

  • public Unity.Entities.Entity m_Menu
    Holds an Entity reference to the related menu. This is typically an Entity representing the UI menu for the asset category. When no menu is assigned this will be Entity.Null.

Properties

  • (none)
    This component exposes its data via public field(s) rather than properties.

Constructors

  • public UIAssetCategoryData(Unity.Entities.Entity menu)
    Creates a new UIAssetCategoryData with m_Menu set to the provided Entity. Example use: new UIAssetCategoryData(menuEntity)

Also note: as a struct, a parameterless default constructor exists implicitly with fields set to default (m_Menu == Entity.Null).

Methods

  • (none)
    There are no methods defined on this struct. It is a plain data container component.

Usage Example

// Example: create an entity and attach a UIAssetCategoryData to point to a menu entity
Entity menuEntity = /* obtain or create the menu entity */;
Entity categoryEntity = entityManager.CreateEntity();

entityManager.AddComponentData(categoryEntity, new Game.Prefabs.UIAssetCategoryData(menuEntity));

// Example: reading the component inside a SystemBase
Entities
    .WithName("ReadUIAssetCategory")
    .ForEach((in Game.Prefabs.UIAssetCategoryData cat) =>
    {
        Entity menu = cat.m_Menu;
        // use menu Entity reference...
    }).Run();