Game.Pathfind.Edge
Assembly: Assembly-CSharp.dll
Namespace: Game.Pathfind
Type: struct
Base: System.ValueType
Summary:
Represents a single edge (segment) used by the game's pathfinding system. An Edge ties together an owning ECS Entity and three NodeID references (start, middle, end) used to represent the geometric/control points of the path segment. It also stores normalized curve positions for the start and end of the usable portion of the curve and carries two specification objects: PathSpecification (path-related attributes) and LocationSpecification (spatial/location metadata). This struct is a plain data container intended for use inside routing/pathfinding code and ECS jobs.
Fields
-
public Unity.Entities.Entity m_Owner
The ECS Entity that owns or represents this edge (for example the segment or path entity). May be Entity.Null when no owner is assigned. -
public NodeID m_StartID
Identifier of the start node for this edge. Used to look up node coordinates/attributes in node stores. -
public NodeID m_MiddleID
Identifier of the middle/control node for this edge. Commonly used for curved segments to store the control point. -
public NodeID m_EndID
Identifier of the end node for this edge. -
public float m_StartCurvePos
Normalized position (typically 0..1) along the underlying curve indicating where the usable/active portion starts or the start parameter used for interpolation. -
public float m_EndCurvePos
Normalized position (typically 0..1) along the underlying curve indicating where the usable/active portion ends or the end parameter used for interpolation. -
public PathSpecification m_Specification
Metadata describing the path characteristics for this edge (lane types, allowed vehicle types, speed limits, priority, etc.). See PathSpecification for details. -
public LocationSpecification m_Location
Spatial/location metadata for the edge (tile/sector info, coordinates offsets or other location indexing used by the pathfinding system).
Properties
- None — this type exposes public fields and does not declare C# properties.
Constructors
public Edge()
Default parameterless struct constructor (implicit). Fields are initialized to their default values: m_Owner = Entity.Null (or default Entity), numeric fields = 0, and struct fields set to their default instances.
Methods
- None — no methods are declared on this struct. It is a plain data container.
Usage Example
using Unity.Entities;
using Game.Pathfind;
// Create and initialize an Edge instance.
// Adjust NodeID/PathSpecification/LocationSpecification construction to match their actual APIs.
Edge edge = new Edge
{
m_Owner = Entity.Null, // or a valid Entity reference
m_StartID = new NodeID(/* id or args */),
m_MiddleID = new NodeID(/* id or args */),
m_EndID = new NodeID(/* id or args */),
m_StartCurvePos = 0.0f,
m_EndCurvePos = 1.0f,
m_Specification = new PathSpecification(/* ... */),
m_Location = new LocationSpecification(/* ... */)
};
// Example usage in pathfinding: look up node positions by NodeID and sample the curve between start and end using m_StartCurvePos/m_EndCurvePos.
Notes: - This struct is typically used inside pathfinding procedures and ECS job code; avoid storing managed references here and prefer plain data to keep it job-friendly. - The exact semantics of PathSpecification, LocationSpecification and NodeID depend on their own definitions — consult their docs for details on constructing and interpreting them.