Skip to content

Game.Prefabs.UIToolbarGroupData

Assembly:
Project assembly containing Game.Prefabs (e.g., Assembly-CSharp or a Game-specific assembly)

Namespace: Game.Prefabs

Type:
struct

Base:
IComponentData, IQueryTypeParameter

Summary:
A small ECS component that marks an entity as a UI toolbar group and carries an integer priority value. This value is typically used by UI systems to order or layer toolbar groups (higher/lower meaning different rendering or input priority depending on the consumer). The type is blittable and suitable for use in Jobs and Entities queries because it implements IComponentData. Implementing IQueryTypeParameter indicates it can be used directly in some query contexts within the codebase.


Fields

  • public int m_Priority
    Holds the priority for this toolbar group. Default is 0 if not set. Consumers (rendering/layout/input systems) use this number to determine ordering between multiple toolbar groups.

Properties

  • This type has no properties. It exposes a single public field.

Constructors

  • public UIToolbarGroupData()
    Implicit default struct constructor: initializes m_Priority to 0. There is no explicit constructor defined in the source.

Methods

  • This struct defines no methods.

Usage Example

// Using EntityManager to add the component to an entity:
var toolbarEntity = entityManager.CreateEntity();
entityManager.AddComponentData(toolbarEntity, new UIToolbarGroupData { m_Priority = 100 });

// In a SystemBase/Job to read priority:
Entities
    .WithAll<UIToolbarGroupTag>() // hypothetical tag for toolbar entities
    .ForEach((in UIToolbarGroupData groupData, Entity e) =>
    {
        int priority = groupData.m_Priority;
        // Use priority to order or layout toolbars...
    }).Schedule();

Additional notes: - Because this is a plain IComponentData struct, prefer using AddComponentData/SetComponent for authoring or converting GameObjects to entities. - Keep priority values consistent across the project (document expected ranges and semantics) so consumers can reliably compare them.