public class : MonoBehaviour
Dynamic Pathfinding that adapts to the world environment.
public bool
bDrawGizmos
Draw the Pathfinding bounding box.
public bool
GizmoOptions
Draw the positions of the individual nodes.
[SerializeField] Vector3
LocalCentre
The local centre of the bounding box.
[SerializeField] Vector3Int
Bounds
The Width, Height, and Depth of the Pathfinding box.
[SerializeField] LayerMask
TraversableLayer
The layer/s that can be walked on.
[SerializeField] [Min(1)] float
PointsPerUnit
The number of Nodes per Unity-world unit.
[SerializeField] bool
bAirIsTraversable
Make the Traversable Layer
[SerializeField] bool
bCheckInsideContacts
Whether or not to check if Nodes inside a contact is traversable.
[SerializeField] EInsideContactQueryMethod
InsideContactMethod
The method to use to determine if a point is inside a Collider.
[SerializeField] bool
bIsDynamic
True if this should adapt to the world environment.
[SerializeField] [Min(1)] int
FramesBetweenUpdate
The number of frames between each dynamic update to the Pathfinding Nodes.
[SerializeField] [Min(1)] int
NodesPerUpdate
The number of Nodes to update per frame.
public MArray<Node>
Nodes
The Nodes that are considered in the Dynamic Pathfinder.
The order is Z, Y, X.
public void
Summary:
Plot the Nodes, adhering to Bounds.
public void
Summary:
Forces all Nodes to reconnect with each other.
public bool
Summary:
Find the shortest path from Origin to Destination.
Params:
Origin:
The Node to begin searching on.
Destination:
The Node to reach.
Path:
The shortest path from Origin to Destination.
Returns:
True if a path from Origin to Destination was found.
public enum EInsideContactQueryMethod : byte
The method for checking if a point is inside a Collider.
Raycast
Raycast from Contact Point to Collider Centre.
Bounds
Use Collider Bounds to Contact Point Check.
RaycastAndBounds
Use both Raycast and Bounds checks.
public class Node : MNode, IHeapItem<Node>
A sample Node class for Pathfinding.
public void
Summary:
Registers N as a neighbour, and this as N's neighbour.
Params:
N:
Neighbour.
public interface <T>
The Interface that T must implement if it is to be used by Pathfinding.
float
F
This Node's F score.
float
G
This Node's G score.
float
H
This Node's H score.
uint
Summary:
How many directions can this Node point to?
bool
Summary:
Is this block traversable?
INode<T>
Summary:
Get the Neighbouring Node at Direction.
Params:
Direction:
The neighbour of this Node in this direction.
float
Summary:
The distance heuristic to calculate pathfinding scores.
Params:
RelativeTo:
Distance to from this T to Relative To.
Returns:
An indicative distance from this T, Relative To.
public abstract class : INode<MNode>
Base class for Nodes to be use in A* Pathfinding.
bIsTraversable
Is this Node an obstacle for Pathfinding?
Neighbours
The connected Nodes to this Node.
public abstract float
Summary:
The distance heuristic to calculate pathfinding scores.
Params:
RelativeTo:
Distance to from this T to Relative To.
Returns:
An indicative distance from this T, Relative To.
public abstract bool
Summary:
Is this block traversable?
INode<MNode>
Summary:
Get the Neighbouring Node at Direction.
Params:
Direction:
The neighbour of this Node in this direction.
public virtual int
Summary:
How many directions can this Node point to?
public static implicit operator bool
Summary:
Is MNode M null?
public class <T> : MonoBehaviour where T : INode<T>, IHeapItem<T>
The MonoBehavior script that manages pathfinding over frames.
[SerializeField] [Min(1)] uint
ComputationsPerFrame
The number of paths to compute per frame.
[SerializeField] [Min(1)] uint
FramesBetweenComputations
The number of frames between computing path/s.
public void
Summary:
Temporarily stop the computation of paths.
public void
Summary:
Continue the computation of paths.
public EStatus
Summary:
Prints the current status of this Path Manager.
Returns:
If this Path Manager is currently Paused, or Running.
public static class <T> where T : MNode, IHeapItem<T>
Provides the A* Pathfinding implementation for T.
public static bool
Summary:
A* pathfinds from Origin to Destination looking uDepth times within a uMapSize.
Params:
Origin:
T position to begin pathfinding.
Destination:
T position to pathfind to.
Path:
Reference T List of that make up the path from Origin to Destination.
Depth:
The depth to search to.
MapSize:
The total size of the map to be traversed. (The number of INodes).
bUseDiagnostics:
Time the duration of Pathfinding?
Returns:
Whether or not a path was found from Origin to Destination within uDepth in uMapSize.
public static class <T> where T : INode<T>, IHeapItem<T>
Computes a number of paths over a number of frames.
public static void
Summary:
Register a path to compute when possible.
Remarks:
This is on a first-in, first-out basis. A Queue.
Params:
Origin:
T position to begin pathfinding.
Destination:
T position to pathfind to.
OnPathCalculated:
What to do when a path is found? List of T pathway.
OnPathFailed:
What to do when a path cannot be found? List of T pathway attempt.
public static bool
Summary:
Computes the next path in FIFO.
Returns:
Whether or not a computation was executed.
public static void
Summary:
Computes BatchSize paths in a single call.
Params:
BatchSize:
The number of paths to compute.
public static uint
Summary:
Gets the number of agents waiting to compute paths.
Returns:
Unsigned integer number of T's awaiting a path.