Game.Prefabs.UIAssetMenuData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
UIAssetMenuData is a small marker/tag component (an "empty" component) used by the game's ECS to identify or mark entities related to UI asset menus. It is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a stable, non-zero size and suitable memory layout for DOTS usage. Because it implements IComponentData and IQueryTypeParameter, it can be added to entities and used in queries as a type parameter for filtering or selecting entity sets.
Fields
- (none)
This struct contains no instance fields — it is an intentionally empty/tag component. The StructLayout(Size = 1) attribute gives it a concrete size despite having no fields.
Properties
- (none)
As an empty value-type component, it exposes no properties.
Constructors
public UIAssetMenuData()
The default parameterless constructor is provided implicitly. No initialization data is required because the component carries no state.
Methods
- (none)
There are no methods defined on this struct.
Usage Example
// Add the tag component to an entity
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var entity = entityManager.CreateEntity();
entityManager.AddComponent<UIAssetMenuData>(entity);
// Use the tag in a SystemBase query to operate on entities that have the tag
public partial class MyUISystem : Unity.Entities.SystemBase
{
protected override void OnUpdate()
{
Entities
.WithAll<UIAssetMenuData>()
.ForEach((Entity e) =>
{
// process UI asset menu entities
}).Schedule();
}
}
Additional notes: - Because this component carries no data, it's useful purely for classification (e.g., marking prefabs or entities that represent UI asset menu elements). - The presence of IQueryTypeParameter indicates it can be used as a query parameter/type constraint in ECS queries.