Skip to content

Game.Tutorials.TutorialTriggerData

Assembly: Assembly-CSharp
Namespace: Game.Tutorials

Type: struct

Base: System.ValueType

Summary:
TutorialTriggerData is an empty/tag ECS component (IComponentData) used to mark entities that act as tutorial triggers. The struct is explicitly given a sequential layout with Size = 1 so that it occupies at least one byte (avoiding a zero-sized type) and can be stored/queried reliably by the Unity.Entities runtime. It also implements IQueryTypeParameter, allowing it to be used conveniently in Entity query abstractions or as a query type parameter.


Fields

  • (none)
    This struct defines no instance fields. It is used purely as a marker/tag component. The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute gives it a fixed size of 1 byte.

Properties

  • (none)
    No managed properties are defined.

Constructors

  • public TutorialTriggerData()
    Default value-type constructor. No initialization required; presence of the component on an entity is the meaningful state.

Methods

  • (none)
    No methods are defined on this type.

Usage Example

// Add the tag component to an entity (EntityManager API)
var entity = entityManager.CreateEntity();
entityManager.AddComponent<TutorialTriggerData>(entity);

// Check for the tag
if (entityManager.HasComponent<TutorialTriggerData>(entity))
{
    // The entity is a tutorial trigger
}

// Query for all tutorial trigger entities (Entities API)
Entities
    .WithAll<TutorialTriggerData>()
    .ForEach((Entity e) =>
    {
        // handle tutorial trigger entity
    })
    .Schedule();

Notes: - Because this is a tag component, you typically don't store data on it; instead you attach other components to the same entity to carry data or behavior. - The StructLayout attribute ensures the type has a non-zero size which can be important for some low-level APIs or serialization. Verify expected assembly and usage in your mod/patch environment.