Game.Tutorials.TutorialActivationData
Assembly:
Assembly-CSharp (game managed assemblies — exact assembly name may vary in the shipped build)
Namespace:
Game.Tutorials
Type:
struct
Base:
System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
A marker/tag ECS component used by the game's tutorial systems to mark entities (or global state entities) as "tutorial activated". The struct is intentionally empty and annotated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a non-zero managed size (1 byte). Implementing IComponentData makes it usable as a DOTS component; implementing IQueryTypeParameter signals it's intended to be used in queries or query-building helpers.
Fields
- None (no instance fields are declared; the type is an empty/tag component).
Note: The struct has the attribute [StructLayout(LayoutKind.Sequential, Size = 1)] which forces a 1-byte layout.
Properties
- None
Constructors
- No explicit constructors. The default parameterless struct constructor is used.
Methods
- None
Usage Example
// Add the tag to an entity (immediate)
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
em.AddComponent<TutorialActivationData>(entity);
// Or add data instance (equivalent, since the struct is empty)
em.AddComponentData(entity, new TutorialActivationData());
// Remove the tag when the tutorial should be deactivated
em.RemoveComponent<TutorialActivationData>(entity);
// Querying entities that have the tutorial activation tag in a SystemBase
public partial class TutorialMonitorSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.WithAll<TutorialActivationData>()
.ForEach((Entity e) =>
{
// Handle activated tutorial entities
})
.Schedule();
}
}
Notes for modders: - This type is intended as a small, zero/one-byte marker component. Prefer AddComponent/RemoveComponent for structural changes rather than modifying component data. - Structural changes (adding/removing components) are potentially expensive in hot loops; use EntityCommandBuffer when performing changes from jobs. - Because of the [StructLayout(Size = 1)] attribute, the type will occupy a minimal non-zero size in memory, which can avoid edge cases with zero-sized components across some runtime/tooling scenarios.