Game.Prefabs.SpaceData
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType
Implements: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
SpaceData is an empty/tag ECS component used by the game's Entity Component System. It is marked with [StructLayout(LayoutKind.Sequential, Size = 1)] so the type has a non-zero size for runtime layout/serialization purposes despite containing no fields. Implements IComponentData so it can be attached to entities, IQueryTypeParameter so it can be used in query filters, and IEmptySerializable to cooperate with the Colossal.Serialization system for empty serializable types.
Fields
- (none)
This struct defines no instance fields — it acts as a marker/tag component.
Properties
- (none)
No properties are declared.
Constructors
public SpaceData()
The default parameterless constructor is the implicit struct constructor. The StructLayout attribute ensures instances occupy 1 byte for serialization/layout even though there are no declared fields.
Methods
- (none)
No methods are declared on this type.
Usage Example
// As a tag component on an entity
var entity = entityManager.CreateEntity();
entityManager.AddComponentData(entity, new SpaceData());
// Use as a query filter in a SystemBase
Entities
.WithAll<SpaceData>()
.ForEach((Entity e) =>
{
// This code runs only for entities that have the SpaceData tag
}).Schedule();