Skip to content

Game.Areas.Clear

Assembly: Assembly-CSharp (in-game)

Namespace: Game.Areas

Type: struct

Base: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary: Clear is an empty/tag component (a marker) used in the Game.Areas namespace. It has an explicit StructLayout attribute with Size = 1 so it has a stable non-zero size for interop/serialization. Because it implements IComponentData it can be attached to ECS entities as a marker. Implementing IQueryTypeParameter makes it suitable for being used directly in query construction, and IEmptySerializable indicates it can be serialized as an empty component by the game's serialization system.


Fields

  • (none)
    This struct does not declare any instance fields. The StructLayout(Size = 1) attribute ensures a non-zero size for marshaling/serialization even though no fields are present.

Properties

  • (none)
    No properties are defined on this type.

Constructors

  • (implicit) public Clear()
    There is no user-declared constructor in the source; the default parameterless constructor is available and typically used when adding this tag component to entities.

Methods

  • (none)
    No methods are declared on this type. It serves purely as an empty/tag component type.

Usage Example

// Adding the Clear tag to an entity
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity someEntity = /* obtain or create entity */;
em.AddComponentData(someEntity, new Game.Areas.Clear());

// Querying for entities that have the Clear tag
Entities
    .WithAll<Game.Areas.Clear>()
    .ForEach((Entity e) =>
    {
        // perform operations on entities marked with Clear
    }).Schedule();

Additional notes: - Because Clear is empty and serializable (IEmptySerializable), it is suitable for use as a light-weight marker that persists across save/load handled by the game's serialization pipeline. - The StructLayout attribute (LayoutKind.Sequential, Size = 1) is commonly used for zero-field structs to avoid issues with native interop or serialization frameworks that expect a non-zero size.