Game.Tutorials.ReplaceActiveData
Assembly: Assembly-CSharp (game/default assembly)
Namespace: Game.Tutorials
Type: struct
Base: IComponentData, IQueryTypeParameter
Summary:
ReplaceActiveData is an empty/tag component (marker) used with Unity DOTS/ECS. It is annotated with [StructLayout(LayoutKind.Sequential, Size = 1)] so it has a non-zero size at runtime (avoiding certain empty-struct optimizations) and can be used as a query marker or to mark entities that participate in tutorial-related replacement logic. Because it implements IQueryTypeParameter it can also be used in query parameter contexts.
Fields
- This struct declares no instance fields.
Additional info: the source uses [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a size of 1 byte for the type.
Properties
- This struct exposes no properties. It is intended purely as a marker/tag component.
Constructors
- Implicit default parameterless constructor (provided by C# for structs).
Additional info: no custom constructors are defined.
Methods
- No methods are defined on this type. Its purpose is to act as a marker for ECS queries and component-based logic.
Usage Example
// Add the marker to an entity using an EntityManager
entityManager.AddComponent<ReplaceActiveData>(entity);
// Remove the marker
entityManager.RemoveComponent<ReplaceActiveData>(entity);
// Use as a query marker in a SystemBase/Entities.ForEach
Entities
.WithAll<ReplaceActiveData>()
.ForEach((Entity e) =>
{
// handle entities marked with ReplaceActiveData
})
.Schedule();
// Use as a query type parameter where supported by your DOTS/ECS version
// (example pseudo-usage; exact API depends on Entities package version)
foreach (var (entity) in SystemAPI.Query<ReplaceActiveData>())
{
// process matching entities
}
Notes: - This type depends on Unity.Entities and is intended for use in DOTS/ECS code paths. - Because it has no payload, prefer using it for tagging/selection logic rather than carrying data.