Skip to content

Game.Prefabs.MarkerNetData

Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType, Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
MarkerNetData is an empty/tag component type used to mark or tag entities related to "marker network" data within the game's ECS. It is decorated with StructLayout(LayoutKind.Sequential, Size = 1) so the struct has a non-zero size (1 byte) for interoperability and to avoid issues with zero-sized types in some serialization/interop scenarios. Because it implements IComponentData it can be attached to entities; implementing IQueryTypeParameter allows it to be used as a direct query type parameter in Unity Entities queries.


Fields

  • This struct defines no instance fields.
    {{ The StructLayout attribute sets the instance size to 1 byte; no managed fields are declared because this is a pure tag/marker component. }}

Properties

  • This type exposes no properties.
    {{ It is intended solely as a lightweight marker component; state is not stored on the managed side. }}

Constructors

  • public MarkerNetData()
    {{ As a C# struct there is an implicit parameterless constructor that yields the default value. No custom constructors are defined. }}

Methods

  • This type defines no methods.
    {{ It is intended to be used only as a tag for queries, filters, or to mark entities. Use ECS APIs to add/remove the component. }}

Usage Example

// Add the MarkerNetData tag to an entity using EntityManager
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity e = entityManager.CreateEntity();
entityManager.AddComponentData(e, new Game.Prefabs.MarkerNetData());

// Use in a System to query entities that have the marker
Entities
    .WithAll<Game.Prefabs.MarkerNetData>()
    .ForEach((Entity ent) =>
    {
        // process tagged entity
    }).Schedule();

{{ Notes: - Because the struct is empty, it is typically used purely as a tag; no data fields are expected to be read or written. - The explicit size (1) prevents the type from being treated as a zero-sized type in systems that rely on non-zero component footprint. - When writing Bags/Serializers or native interop code, respect the 1-byte size defined by the StructLayout attribute. }}