Skip to content

Game.FenceData

Assembly: Game
Namespace: Game.Prefabs

Type: struct

Base: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary:
FenceData is an empty/tag ECS component used to mark entities that represent fence prefabs. The struct is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a non-zero size for serialization/memory layout and implements IEmptySerializable for the Colossal serialization system and IQueryTypeParameter so it can be used in ECS queries. It contains no runtime payload — it functions as a marker/tag.


Fields

  • (none)
    This struct declares no fields. It's intentionally empty and used purely as a tag component.

Properties

  • (none)

Constructors

  • public FenceData()
    Structs have an implicit parameterless constructor. No explicit constructors are defined.

Methods

  • (none)
    There are no methods on this type.

Usage Example

using Unity.Entities;
using Game.Prefabs;

// Add FenceData as a tag component to an entity
var em = World.DefaultGameObjectInjectionWorld.EntityManager;
var entity = em.CreateEntity();
em.AddComponentData(entity, new FenceData());

Additional notes: - Because FenceData is empty, treat it as a boolean/tag: presence = true, absence = false. - The StructLayout(Size = 1) avoids zero-size type issues for native serialization or layout assumptions. - IEmptySerializable indicates the type participates in the game's custom serialization even though it has no payload.