Game.Common.Deleted
Assembly:
Assembly-CSharp (game/mod assembly where Game.Common types reside)
Namespace: Game.Common
Type: struct
Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter
Summary: Deleted is an empty/tag component used by the game's ECS to mark an entity as deleted or pending removal. It has no instance data — its presence on an entity is the flag. The struct is explicitly laid out with Size = 1 to ensure a minimal non-zero footprint in memory and predictable layout for the runtime and native interop. Implementing IQueryTypeParameter allows the type to be used in query/filter contexts.
Fields
This struct has no instance fields. It is intentionally empty (a tag component). The StructLayout attribute applied in the source sets the managed layout to Sequential and fixes the size to 1 byte to avoid a zero-sized type.
Properties
This struct exposes no properties.
Constructors
- Implicit default constructor (value-type default).
There are no explicit constructors defined in the source.
Methods
There are no methods defined on this type.
Usage Example
// mark an entity as deleted (tag component)
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity e = entityManager.CreateEntity();
entityManager.AddComponentData(e, new Game.Common.Deleted());
// query for all entities marked deleted
Entities.WithAll<Game.Common.Deleted>()
.ForEach((Entity ent) =>
{
// perform cleanup, remove components, or destroy entity
// e.g. schedule actual destruction:
// entityManager.DestroyEntity(ent);
})
.Run();