Skip to content

Game.Prefabs.InfomodeData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

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

Summary:
InfomodeData is an empty/tag ECS component used by the game's entity system to mark or identify entities related to an "infomode" (information mode) prefab or feature. The struct is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to force a non-zero managed size (1 byte), which helps avoid issues with zero-sized types in some native or interop scenarios. Implements IComponentData so it can be attached to entities, and IQueryTypeParameter so it can be used directly in ECS queries/parameters.


Fields

  • This struct declares no instance fields. The StructLayout attribute sets an explicit size but no managed fields are present.

Properties

  • This struct exposes no properties.

Constructors

  • public InfomodeData()
    The default parameterless constructor exists implicitly for the value type. No custom constructor logic is defined in source.

Methods

  • No methods are defined on this type. It serves purely as a marker/tag component.

Usage Example

// Add the tag to an entity (EntityManager API)
var infomodeTag = new InfomodeData();
entityManager.AddComponentData(someEntity, infomodeTag);

// Use as a query parameter in a System to process all entities that have the tag
Entities
    .WithAll<InfomodeData>()
    .ForEach((Entity e, in SomeOtherComponent comp) =>
    {
        // handle infomode-related logic for entity e
    })
    .Schedule();

// Alternatively, use IQueryTypeParameter-compatible usage (depending on Entities API version)
public partial struct MySystem : ISystem
{
    public void OnUpdate(ref SystemState state)
    {
        // Example: query by type parameter if supported by your ECS version
        state.EntityManager.GetAllEntities(); // placeholder - use appropriate query APIs
    }
}

Notes: - Because this is an empty marker type, it is intended only for identification/filtering, not to carry data. - The explicit size (Size = 1) prevents it from being treated as a zero-sized type by native/interop code or some ECS internals.