Game.Prefabs.UIObjectData
Assembly:
Namespace: Game.Prefabs
Type: struct
Base: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
UIObjectData is a simple ECS component used to attach UI-related metadata to an entity in the prefabs subsystem. It stores an Entity reference that groups related UI objects and an integer priority value that can be used to order or layer UI elements. The struct is a plain data component (blittable) suitable for use in Entity queries and systems.
Fields
-
public Unity.Entities.Entity m_Group
Reference to another Entity that represents the UI group or parent this UI object belongs to. Used to associate the UI object with a grouping entity (for grouping, visibility, or parent-child relationships). -
public System.Int32 m_Priority
Integer priority value used to control ordering or layering of UI objects (for example, which elements should be rendered or processed before others).
Properties
This type does not define any properties.
Constructors
public UIObjectData()
Default value-type constructor provided by C#. Fields should be set explicitly when adding the component to an entity (e.g., via EntityManager.AddComponentData or when creating the entity).
Methods
This type does not define any methods.
Usage Example
// Add the component to an existing entity
var uiData = new UIObjectData
{
m_Group = groupEntity, // Entity handle of the group/parent
m_Priority = 100 // priority value
};
entityManager.AddComponentData(uiEntity, uiData);
// Query for entities that have UIObjectData and read fields in a system
Entities
.ForEach((Entity e, in UIObjectData ui) =>
{
// use ui.m_Group and ui.m_Priority
})
.Schedule();