Game.Tutorials.TutorialPhaseCanDeactivate
Assembly: Assembly-CSharp (game assembly where game types live)
Namespace: Game.Tutorials
Type: struct TutorialPhaseCanDeactivate
Base: System.ValueType
(Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter)
Summary:
TutorialPhaseCanDeactivate is an empty marker/component struct used by the game's ECS to mark a tutorial phase entity as allowed to deactivate. It is explicitly laid out with Size = 1 to ensure a non-zero size for low-level interop / memory layout reasons. Because it implements IComponentData it is used like any other ECS component; implementing IQueryTypeParameter allows it to be used in query parameter contexts.
Fields
- This struct declares no instance fields; it is an empty marker component (defined only as a value type with Size = 1 via StructLayout).
{{ This type is intentionally empty — it exists only as a tag to signal "can deactivate" to systems that process tutorial phases. }}
Properties
- This type declares no properties.
{{ Use it purely as a tag component; no state is carried on the component itself. }}
Constructors
public TutorialPhaseCanDeactivate()
{{ The default parameterless value-type constructor is used (no runtime initialization required). The StructLayout(Size = 1) attribute ensures the struct occupies one byte in memory. }}
Methods
- This type defines no methods.
{{ It is intended to be used by ECS systems and queries; logic for activation/deactivation lives in systems that test for the presence/absence of this component. }}
Usage Example
// Add the tag to an existing entity to mark its tutorial phase as able to deactivate
entityManager.AddComponent<TutorialPhaseCanDeactivate>(entity);
// Remove the tag to mark it as not allowed to deactivate
entityManager.RemoveComponent<TutorialPhaseCanDeactivate>(entity);
// Query for entities that can be deactivated in a SystemBase
Entities
.WithAll<TutorialPhaseCanDeactivate>()
.ForEach((Entity entity, in SomeTutorialData data) =>
{
// perform deactivation logic
}).Schedule();
{{ Notes: - The [StructLayout(LayoutKind.Sequential, Size = 1)] attribute forces a 1-byte size; this is a common pattern for marker components to avoid zero-size types in some low-level contexts. - Because it's an IQueryTypeParameter, it can be used directly in query construction (WithAll/WithNone etc.) to filter entities. }}