Game.Prefabs.StaticObjectData
Assembly: Game
Namespace: Game.Prefabs
Type: struct
Base: System.ValueType, IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
StaticObjectData is an empty "tag" component used by the ECS to mark entities that represent static prefab objects. The struct is attributed with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a stable, non-zero size for interop/serialization. Implementing IComponentData makes it usable as a Unity.Entities component; IQueryTypeParameter allows it to be used as a query parameter/type in entity queries; IEmptySerializable indicates it participates in the game's custom serialization pathway as an empty/marker serializable type.
Fields
- (none)
This struct contains no instance fields — it is intentionally empty and used as a marker/tag type.
Properties
- (none)
No properties are defined on this type.
Constructors
- (implicit) default StaticObjectData()
As a struct, it has the implicit default constructor that initializes no data.
Methods
- (none)
No methods are declared. Behavior is purely semantic via the presence/absence of the component on an entity.
Usage Example
// Add the marker component to an entity using an EntityManager:
EntityManager.AddComponent<StaticObjectData>(entity);
// Create an entity archetype that includes the tag:
var archetype = EntityManager.CreateArchetype(typeof(StaticObjectData), typeof(SomeOtherComponent));
var staticEntity = EntityManager.CreateEntity(archetype);
// Use the tag in a query to select static-prefab entities:
Entities
.WithAll<StaticObjectData>()
.ForEach((Entity e, in SomeOtherComponent comp) =>
{
// process static prefab entity
}).Schedule();