Game.Tutorials.TutorialCompleted
Assembly:
Assembly-CSharp (typical Unity/game assembly for user scripts; actual assembly may vary by build)
Namespace:
Game.Tutorials
Type:
struct (value type, tag/marker component)
Base:
System.ValueType
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary:
TutorialCompleted is a marker/tag ECS component used to mark an entity as having completed a tutorial. It contains no runtime fields (it is an empty marker), but is explicitly given a layout size of 1 byte via StructLayout to avoid being treated as a zero-sized type by some systems. Use it to add a simple boolean-like flag to entities or to filter queries (WithAll/WithNone) in the Unity DOTS/Entities system.
Fields
- None.
This struct declares no instance fields. It is used purely as a tag/marker component. The StructLayout(LayoutKind.Sequential, Size = 1) attribute sets the type size to 1 byte.
Properties
- None.
No properties are defined on this component; it is an empty marker type.
Constructors
- Implicit default constructor (
public TutorialCompleted()
)
As a value type, it has the implicit parameterless constructor that produces the marker value. No custom constructors are defined.
Methods
- None.
There are no methods on this type — it functions solely as a data-less tag for ECS queries and component presence checks.
Usage Example
// Add the marker to an entity (EntityManager API)
entityManager.AddComponentData(entity, new TutorialCompleted());
// Check whether an entity has the marker
if (entityManager.HasComponent<TutorialCompleted>(entity))
{
// tutorial is completed for this entity
}
// Querying entities that have completed the tutorial (Entities API)
Entities
.WithAll<TutorialCompleted>()
.ForEach((Entity e) =>
{
// process entities that completed the tutorial
}).Schedule();
Additional notes: - The IQueryTypeParameter implementation allows this type to be used directly in query declarations (WithAll/WithAny/WithNone). - The StructLayout(Size = 1) ensures the struct is not zero-sized which can be useful for some native/ECS layout considerations.