Skip to content

Game.Buildings.Signature

Assembly:
Assembly-CSharp (typical for Cities: Skylines 2 mods)
Namespace: Game.Buildings

Type: struct Signature

Base: Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable

Summary: Signature is an empty/tag component used with Unity's DOTS ECS in the game's building domain. It is declared with a fixed layout and a Size of 1 byte via StructLayout to ensure the component has a non-zero size when serialized or stored in component arrays. Implementing IEmptySerializable indicates it participates in the game's custom serialization system for empty components; IQueryTypeParameter makes it usable as a type parameter in ECS queries. Typical usage is as a marker/tag on building-related entities to represent a concept or state without storing any payload data.


Fields

  • None.
    This struct declares no fields by design: it functions as a marker/tag component. The StructLayout attribute is applied to control the managed layout/size (Size = 1) even though there are no fields.

Properties

  • None.
    As an empty struct implementing IComponentData, it carries no runtime properties.

Constructors

  • Implicit default constructor.
    Being a value type (struct) it has the implicit parameterless constructor that initializes it to default. No custom constructors are declared.

Methods

  • None.
    There are no methods defined on this type. Its behavior is entirely defined by the interfaces it implements and how systems/queries treat it.

Usage Example

using Unity.Entities;
using Game.Buildings;

// Add as a tag component to an existing entity
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity buildingEntity = /* obtain or create entity */;
entityManager.AddComponent<Signature>(buildingEntity);

// Or create an archetype that includes the signature marker
EntityArchetype archetype = entityManager.CreateArchetype(
    typeof(Translation),
    typeof(RenderMesh),
    typeof(Signature) // marker component included in archetype
);

// Using an EntityCommandBuffer (e.g., from a system)
var ecb = new EntityCommandBuffer(Allocator.Temp);
ecb.AddComponent<Signature>(buildingEntity);
ecb.Playback(entityManager);
ecb.Dispose();

Additional notes: - The StructLayout(LayoutKind.Sequential, Size = 1) attribute ensures the type occupies one byte, which can be important for the game's serialization or storage expectations for empty components. - IEmptySerializable is a Colossal-specific marker for empty types that must support the game's serialization pipeline even without fields.