Game.Pathfind.PathfindPath
Assembly:
{{ Likely included in the game's main runtime assembly (e.g. Assembly-CSharp) — check your build to confirm. }}
Namespace: Game.Pathfind
Type:
struct
Base:
System.ValueType
Summary:
A lightweight value-type that represents a single path target/entry used by the game's pathfinding code. It contains a target Entity, a 2D offset (float2) used as a delta from the target position, and flags that control per-element path behavior. This struct is intended to be a simple container for pathfinding-related data; consult the surrounding pathfinding systems and the PathElementFlags enum for exact semantics of the flags and the delta usage.
Fields
-
public Entity m_Target
Represents the entity that this path element targets. This is an ECS Entity handle — typically used to reference the destination (for example a building, vehicle or node). If using this in systems you must ensure the entity exists / is valid before accessing its components. -
public float2 m_TargetDelta
A 2D offset (from Unity.Mathematics) describing a positional delta relative to the target. Typically used to offset the actual target position (for example to pick a specific approach point). Coordinates are in world units; depending on the callers this may represent (X,Z) planar offset — check calling code to confirm coordinate convention. -
public PathElementFlags m_Flags
A bitmask/enum describing behavior modifiers for this path element (e.g., whether the element is optional, must be exact, etc.). Refer to the PathElementFlags enum definition to see available flags and their meanings.
Properties
- None (plain public fields only)
Constructors
public PathfindPath()
Implicit default (value) constructor provided by C# for structs. Initialize fields manually or with an object initializer; there is no explicit custom constructor in the source.
Example explicit initializer:
var p = new PathfindPath {
m_Target = someEntity,
m_TargetDelta = new float2(1.5f, -0.5f),
m_Flags = PathElementFlags.None
};
Methods
- None (no methods defined on the struct)
Usage Example
using Unity.Entities;
using Unity.Mathematics;
using Game.Pathfind;
// create / initialize a path element
Entity destinationEntity = /* obtain entity reference */;
var pathElement = new PathfindPath {
m_Target = destinationEntity,
m_TargetDelta = new float2(0f, 0f),
m_Flags = PathElementFlags.None
};
// store in a native collection or pass to pathfinding routines
NativeList<PathfindPath> pathList = new NativeList<PathfindPath>(Allocator.Temp);
pathList.Add(pathElement);
// ... use pathList with pathfinding systems, then dispose
pathList.Dispose();
{{ Additional notes: - This struct is a plain data container; mutation is by value. When used in collections or ECS components be mindful of copying semantics. - For exact semantics of m_TargetDelta (which axes it maps to) and meanings of PathElementFlags, inspect the callers and the enum definition in the codebase. - Ensure proper use of Unity.Collections/Allocators when storing instances in native containers. }}