Skip to content

Game.Tutorials.TutorialListData

Assembly:
Assembly-CSharp (game)

Namespace:
Game.Tutorials

Type:
struct

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

Summary:
Component data struct used by the game's tutorial system to tag entities that represent tutorial lists and to carry a priority value. As an IComponentData it can be added to ECS entities; implementing IQueryTypeParameter allows it to be used directly in entity queries/ArchetypeQuery optimizations. The single field m_Priority is typically used to determine ordering or importance of tutorial lists.


Fields

  • public int m_Priority
    Integer priority value for this tutorial list. Higher or lower values may be used by tutorial systems to sort or choose which tutorial list to present first, depending on the game's logic.

  • private fields: none

Properties

  • None

Constructors

  • public TutorialListData(int priority)
    Constructs the component with the given priority value and stores it in m_Priority.

Methods

  • None (no methods defined on this struct)

Usage Example

// Example: creating an entity with the TutorialListData component
using Unity.Entities;
using Game.Tutorials;

public class TutorialSetupSystem : SystemBase
{
    protected override void OnCreate()
    {
        base.OnCreate();
        var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;

        // Create an entity with the TutorialListData component
        var archetype = entityManager.CreateArchetype(typeof(TutorialListData));
        var tutorialEntity = entityManager.CreateEntity(archetype);

        // Set the priority (e.g., 10)
        entityManager.SetComponentData(tutorialEntity, new TutorialListData(10));
    }

    protected override void OnUpdate()
    {
        // Example: query entities with TutorialListData
        Entities.ForEach((in TutorialListData listData) =>
        {
            int priority = listData.m_Priority;
            // use priority for ordering/selection logic
        }).Schedule();
    }
}