Game.Tutorials.TriggerPreCompleted
Assembly: Assembly-CSharp
Namespace: Game.Tutorials
Type: struct
Base: System.ValueType, IComponentData, IQueryTypeParameter
Summary:
TriggerPreCompleted is an empty/tag component used by the tutorial system to mark a tutorial trigger as already completed (pre-completed). The struct carries no runtime data — it functions purely as a marker. It is declared with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a 1-byte size for interop/representation reasons. Implementing IQueryTypeParameter allows it to be used conveniently in ECS query APIs.
Fields
-
This component defines no fields.
It is a tag component (no payload); presence/absence on an entity is the meaningful information. -
Attributes:
[StructLayout(LayoutKind.Sequential, Size = 1)]
This forces the struct to occupy 1 byte instead of being zero-sized, which can be useful for certain interop scenarios or to guarantee a non-zero size when required by some native systems.
Properties
- None. This type exposes no properties.
Constructors
public TriggerPreCompleted()
(implicit)
The default parameterless constructor is available. Because the struct contains no data, construction is trivial.
Methods
- None. There are no methods defined on this type.
Usage Example
// Add this tag to an entity using EntityManager
var entity = entityManager.CreateEntity();
entityManager.AddComponentData(entity, new Game.Tutorials.TriggerPreCompleted());
// Check if an entity has the tag
bool isPreCompleted = entityManager.HasComponent<Game.Tutorials.TriggerPreCompleted>(entity);
// Remove the tag to mark it as not pre-completed
entityManager.RemoveComponent<Game.Tutorials.TriggerPreCompleted>(entity);
// Query for all entities that are marked pre-completed in a SystemBase
public partial class TutorialSystem : SystemBase
{
protected override void OnUpdate()
{
Entities
.WithAll<Game.Tutorials.TriggerPreCompleted>()
.ForEach((Entity e) =>
{
// handle pre-completed tutorial triggers...
}).Schedule();
}
}
{{ This marker component is intended solely for flow-control within the tutorial systems. Because it implements IQueryTypeParameter, it integrates smoothly with ECS query APIs that accept type parameters. If you need to store data about pre-completion (timestamps, reasons, etc.), use a separate IComponentData struct with fields. }}