Skip to content

Game.Tutorials.AdvisorActivation

Assembly:
Namespace: Game.Tutorials

Type: struct

Base: IComponentData, IQueryTypeParameter

Summary:
AdvisorActivation is an empty (tag) ECS component used by the tutorial/advisor subsystem. It carries no data and serves as a marker to indicate that an entity (or the game state) should be treated as having the advisor activated. The struct is annotated with StructLayout(LayoutKind.Sequential, Size = 1) so it has a non-zero size at the native level, which is a common pattern for tag components in Unity ECS.


Fields

This component declares no instance fields. It is intentionally empty and used purely as a tag.

Properties

This type exposes no properties.

Constructors

  • There is no explicit constructor declared. As a value type it has the implicit default constructor that initializes the value to default (all zeros). Instances are typically created as "new AdvisorActivation()" when adding the component to an entity.

Methods

This type defines no methods.

Usage Example

// Add the tag to an entity (EntityManager API)
entityManager.AddComponentData(entity, new AdvisorActivation());

// Or with higher-level APIs inside a SystemBase:
Entities
    .WithAll<AdvisorActivation>()
    .ForEach((Entity e) =>
    {
        // Handle advisor-activated entities here
    })
    .Schedule();

{{ Additional notes: - Because this is a marker component it is cheap to add/remove and useful for filtering queries (WithAll, WithNone, HasComponent). - The IQueryTypeParameter interface indicates the type can be used as a query parameter in some ECS query APIs. - The StructLayout(Size = 1) attribute ensures the type occupies at least one byte in memory which can be important for native interop or for some ECS internal assumptions about non-zero sized components. }}