Game.Tutorials.InputTriggerData
Assembly:
Assembly-CSharp (typical game/mod assembly; adjust if your mod places this type in a different assembly)
Namespace:
Game.Tutorials
Type:
struct
Base:
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
InputTriggerData is an empty/tag component (IComponentData) used to mark entities that should act as "input triggers" for tutorial systems. The struct is annotated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a non-zero, sequential layout (useful for runtime/interop and ECS component constraints). Implementing IQueryTypeParameter makes it convenient to use this type directly in ECS queries/filters. Because it contains no fields, it functions purely as a marker for filtering and identification within systems.
Fields
- This struct declares no backing fields. It is an empty/tag component used only for marking entities.
Properties
- This struct declares no properties. It implements marker interfaces only.
Constructors
public InputTriggerData()
The default parameterless constructor is provided implicitly. No initialization is required because the component carries no data.
Methods
- This type declares no methods. Use ECS APIs (EntityManager, EntityCommandBuffer, queries, etc.) to work with the tag.
Usage Example
// Add the tag to an entity using EntityManager
entityManager.AddComponent<InputTriggerData>(entity);
// Or add via an EntityCommandBuffer inside a system/job
entityCommandBuffer.AddComponent<InputTriggerData>(entity);
// Remove the tag
entityManager.RemoveComponent<InputTriggerData>(entity);
// Query for entities that have the tag in a SystemBase
Entities
.WithAll<InputTriggerData>()
.ForEach((Entity e) =>
{
// handle input-triggered tutorial logic for e
}).Schedule();
// Check if an entity has the tag
bool has = entityManager.HasComponent<InputTriggerData>(entity);
{{ Notes: - Use this component as a lightweight marker to identify entities that should trigger tutorial behavior or to filter entities in systems. - The StructLayout(Size = 1) ensures the type has a stable non-zero size, which avoids issues that can arise with empty structs in certain runtime or interop scenarios. - Because the struct carries no payload, consider using Add/RemoveComponent patterns or chunk-based queries rather than per-entity data storage for related state (store state in separate components if needed). }}