Struct Comp<T>
Typed component handle — identifies a component type within the ECS system.
Stored as static readonly fields on archetype classes to declare schema.
public readonly struct Comp<T> where T : unmanaged
Type Parameters
TThe unmanaged component data type.
- Inherited Members
Remarks
ComponentTypeId: global type registry ID (shared when the same component type appears in multiple archetypes).
Slot resolution happens at runtime via GetSlot(int) — avoids static initialization ordering issues with inheritance.
Methods
Default()
Create a zero-initialized ComponentValue for use during entity spawning.
public ComponentValue Default()
Returns
Set(in T)
Create a ComponentValue with the given data for use during entity spawning.
public ComponentValue Set(in T value)
Parameters
valueT