Skip to content

Game.Tutorials.BuildingFireActivationData

Assembly:
Namespace: Game.Tutorials

Type: struct

Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
BuildingFireActivationData is an empty (marker/tag) component used by the tutorial/game logic to mark or identify entities for "building fire activation" behavior. The struct is attributed with [StructLayout(LayoutKind.Sequential, Size = 1)] so it has a defined size (1 byte) rather than being a zero-sized type; this can be useful for certain serialization, interop, or engine-specific expectations when the component is used as a tag in ECS queries or systems.


Fields

  • (none)
    This struct contains no explicit fields — it is used as a tag/component marker.

Properties

  • (none)

Constructors

  • public BuildingFireActivationData()
    Implicit parameterless constructor. As an empty/tag struct, it carries no data; constructing a new instance simply yields the tag value used when adding the component to an entity.

Methods

  • (none)
    There are no methods defined on this type; it is purely a marker implementing IComponentData and IQueryTypeParameter.

Usage Example

// Example: add the tag to an entity to trigger tutorial/building-fire logic
public partial class TutorialFireSystem : SystemBase
{
    protected override void OnUpdate()
    {
        // Example: find tutorial target building entities and tag them
        Entities
            .WithAll<TutorialTargetTag>() // some tutorial selection criteria
            .ForEach((Entity e, int entityInQueryIndex) =>
            {
                // Add the tag component to the entity
                EntityManager.AddComponent<BuildingFireActivationData>(e);
                // Alternatively:
                // EntityManager.AddComponentData(e, new BuildingFireActivationData());
            })
            .WithoutBurst()
            .Run();
    }
}

Notes and tips: - Because this type implements IQueryTypeParameter, it can be used directly in generic query construction patterns in ECS code where the component type needs to be passed as a parameter to query-building utilities. - The StructLayout(Size = 1) attribute ensures the struct occupies one byte in memory instead of being a zero-sized type; this can affect how the ECS/storage treats the component and can help avoid certain edge cases in serialization or native interop.