Skip to content

Game.MarkerMarkerData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

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

Summary:
MarkerMarkerData is a lightweight ECS component that stores a MarkerType value for an entity. It's intended to tag or classify prefab marker entities (for example, different kinds of in-world markers used by the game or mods) so systems can filter or react based on the marker type. Because it implements IComponentData it is a pure data component suitable for burstable, job-friendly usage; implementing IQueryTypeParameter makes it usable directly in certain query APIs.


Fields

  • public MarkerType m_MarkerType
    Holds the marker classification for the entity. MarkerType is expected to be an enum (not included here) that defines the possible marker kinds (for example: spawn point, waypoint, decoration, etc.). Use this field to read or set the marker category on an entity.

Properties

  • This type does not declare any properties. It only exposes the public field above.

Constructors

  • public MarkerMarkerData()
    Implicit parameterless constructor provided by the C# compiler. You can initialize the field inline when creating the component value:
  • Example: new MarkerMarkerData { m_MarkerType = MarkerType.Spawn }

Methods

  • This struct does not declare any methods. It is a plain data container. Note: implementing IQueryTypeParameter allows usage in certain entity query APIs but does not add runtime methods on this type.

Usage Example

// Create an entity with MarkerMarkerData
var archetype = EntityManager.CreateArchetype(
    typeof(Game.Prefabs.MarkerMarkerData),
    /* other components... */
);

var entity = EntityManager.CreateEntity(archetype);
EntityManager.SetComponentData(entity, new Game.Prefabs.MarkerMarkerData {
    m_MarkerType = MarkerType.SpawnPoint
});

// Querying in a SystemBase
public partial class MarkerProcessingSystem : SystemBase
{
    protected override void OnUpdate()
    {
        Entities
            .WithAll<Game.Prefabs.MarkerMarkerData>()
            .ForEach((ref Game.Prefabs.MarkerMarkerData marker) =>
            {
                if (marker.m_MarkerType == MarkerType.SpawnPoint)
                {
                    // handle spawn point marker
                }
            }).ScheduleParallel();
    }
}