Game.Tutorials.TutorialActivated
Assembly:
{{ Likely compiled into the game's runtime assembly (e.g. Assembly-CSharp.dll). Confirm the exact assembly in your build if needed. }}
Namespace:
Game.Tutorials
Type:
public struct
Base:
System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
{{ TutorialActivated is a marker/tag component (an empty IComponentData) used to indicate that a tutorial has been activated for an entity or in the ECS world. The struct is given an explicit layout with Size = 1 to ensure it occupies a predictable, minimal amount of memory as a pure tag component. It can be used in queries (WithAll/WithAny) and as a lightweight flag in systems. }}
Fields
- This type defines no instance fields.
{{ The struct is intentionally empty (size forced to 1 via StructLayout) to serve as a tag component. }}
Properties
- This type defines no properties.
{{ Use it only as a marker/tag; there is no payload data. }}
Constructors
public TutorialActivated()
{{ The default parameterless value-type constructor exists implicitly. There are no explicit constructors defined. To add the tag to an entity, create a new instance (new TutorialActivated()). }}
Methods
- This type defines no methods.
{{ Behavior is provided by systems that query for or add/remove this component; there are no built-in methods on the type. }}
Usage Example
// Add the tag to an entity (EntityManager API)
entityManager.AddComponentData(entity, new Game.Tutorials.TutorialActivated());
// Or with the convenience AddComponent (API varies by Entities version)
entityManager.AddComponent<Game.Tutorials.TutorialActivated>(entity);
// Querying for entities that have the TutorialActivated tag in a SystemBase
Entities
.WithAll<Game.Tutorials.TutorialActivated>()
.ForEach((Entity e) =>
{
// process activated-tutorial entities
})
.Schedule();
// Removing the tag to mark deactivation
entityManager.RemoveComponent<Game.Tutorials.TutorialActivated>(entity);
{{ Notes: - The StructLayout attribute with Size = 1 makes this an explicit 1-byte tag; this is common for marker components to avoid zero-size type edge cases and to ensure stable memory layout. - Because this is an empty IComponentData, prefer using it in queries (WithAll/WithAny/WithNone) or as a simple presence/absence flag rather than storing data. - Verify the exact EntityManager/System API for your Entities package version: method names (AddComponentData vs AddComponent) can differ between Unity.Entities versions. }}