Skip to content

Game.Prefabs.PathfindTransportData

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

Type: struct

Base: System.ValueType

Summary:
PathfindTransportData is a small DOTS ECS component used by the game's pathfinding systems to provide cost parameters for transport-related pathfinding. It groups three PathfindCosts values that influence ordering, starting and travel cost calculations for transport pathfinding algorithms. This struct implements Unity.Entities.IComponentData so it can be attached to entities, and IQueryTypeParameter to be usable in certain query parameter contexts.


Fields

  • public Game.Pathfind.PathfindCosts m_OrderingCost
    Defines the costs used when ordering or prioritizing candidate paths for transport pathfinding (for example, used when comparing or sorting path options before selection).

  • public Game.Pathfind.PathfindCosts m_StartingCost
    Costs applied at the start of a path (initialization penalties or bonuses influencing route selection at origin).

  • public Game.Pathfind.PathfindCosts m_TravelCost
    Per-segment or per-step travel costs applied while traversing the path (used to accumulate total path cost during pathfinding).

Properties

  • This struct has no properties. It exposes only the three public fields above.

Constructors

  • public PathfindTransportData()
    The default (implicit) constructor initializes the struct fields to their default values. Create an instance by assigning each PathfindCosts field as needed before adding the component to an entity.

Methods

  • This struct declares no methods. It is a plain data container (IComponentData) consumed by pathfinding systems.

Usage Example

// Example: create and add the component to an entity
var transportData = new PathfindTransportData
{
    m_OrderingCost = new Game.Pathfind.PathfindCosts { /* set cost values here */ },
    m_StartingCost = new Game.Pathfind.PathfindCosts { /* set cost values here */ },
    m_TravelCost = new Game.Pathfind.PathfindCosts { /* set cost values here */ }
};

// Assuming 'entityManager' and 'entity' are available:
entityManager.AddComponentData(entity, transportData);

// Or inside a system when creating entities:
var e = entityManager.CreateEntity(typeof(PathfindTransportData));
entityManager.SetComponentData(e, transportData);

Notes: - PathfindCosts is defined in the Game.Pathfind namespace and typically contains fields controlling numeric cost weights used by pathfinding algorithms. Adjust fields in PathfindCosts to tune transport route selection behavior. - Because this type implements IComponentData, it should be used with the Unity Entities API (EntityManager, systems, archetypes, queries).