Skip to content

Game.Prefabs.RouteConfigurationData

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: IComponentData, IQueryTypeParameter

Summary:
RouteConfigurationData is a lightweight ECS component that holds Entity references to prefab assets used by the routing/pathfinding and visualization systems. Each field is expected to reference an Entity that represents a prefab (visualization, notification, or fallback) used when constructing or displaying routes for different transport types in the game.


Fields

  • public Entity m_PathfindNotification
    Holds an Entity (prefab) used to spawn a notification or marker when pathfinding events occur (for example, to signal completion/failure of a path request).

  • public Entity m_CarPathVisualization
    Entity prefab used to visualize road/car routes (e.g., path overlays or gizmos showing car routes).

  • public Entity m_WatercraftPathVisualization
    Entity prefab used to visualize watercraft/boat routes.

  • public Entity m_AircraftPathVisualization
    Entity prefab used to visualize aircraft routes.

  • public Entity m_TrainPathVisualization
    Entity prefab used to visualize train/rail routes.

  • public Entity m_HumanPathVisualization
    Entity prefab used to visualize pedestrian/human routes.

  • public Entity m_MissingRoutePrefab
    Entity prefab used as a fallback or indicator when a route cannot be found or is invalid (e.g., a missing-route marker).

Properties

This struct exposes no properties; it only contains public fields.

Constructors

  • public RouteConfigurationData()
    Value-type default constructor (auto-generated). Typical usage is to construct and assign fields manually or via EntityManager.AddComponentData.

Methods

This struct defines no methods.

Usage Example

// Assume these variables are valid prefab Entities obtained elsewhere
Entity pathfindNotificationPrefab = ...;
Entity carPathPrefab = ...;
Entity trainPathPrefab = ...;
Entity missingRoutePrefab = ...;

// Create and assign the component to an existing entity (e.g., a manager entity)
var routeConfig = new RouteConfigurationData
{
    m_PathfindNotification = pathfindNotificationPrefab,
    m_CarPathVisualization = carPathPrefab,
    m_TrainPathVisualization = trainPathPrefab,
    m_MissingRoutePrefab = missingRoutePrefab,
    // other fields left as Entity.Null if not used
};

entityManager.AddComponentData(managerEntity, routeConfig);

Notes: - All fields are expected to be Entity references to prefabs (Entity.Null if not provided). - This component is intended to be read by systems that spawn visualization prefabs or notification entities in response to routing/pathfinding logic.