A* Pathfinding Project  4.2.7
The A* Pathfinding Project for Unity 3D
EndingConditionDistance Class Reference

Target is found when the path is longer than a specified value. More...

Detailed Description

Target is found when the path is longer than a specified value.

Actually this is defined as when the current node's G score is >= a specified amount (EndingConditionDistance.maxGScore).
The G score is the cost from the start node to the current node, so an area with a higher penalty (weight) will add more to the G score. However the G score is usually just the shortest distance from the start to the current node.

See also
Pathfinding.ConstantPath which uses this ending condition

Public Member Functions

 EndingConditionDistance (Path p, int maxGScore)
 
override bool TargetFound (PathNode node)
 Has the ending condition been fulfilled. More...
 
- Public Member Functions inherited from PathEndingCondition
 PathEndingCondition (Path p)
 

Public Attributes

int maxGScore = 100
 Max G score a node may have. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PathEndingCondition
 PathEndingCondition ()
 
- Protected Attributes inherited from PathEndingCondition
Path path
 Path which this ending condition is used on. More...
 

Constructor & Destructor Documentation

◆ EndingConditionDistance()

EndingConditionDistance ( Path  p,
int  maxGScore 
)

Member Function Documentation

◆ TargetFound()

override bool TargetFound ( PathNode  node)
virtual

Has the ending condition been fulfilled.

Parameters
nodeThe current node.

Implements PathEndingCondition.

Member Data Documentation

◆ maxGScore

int maxGScore = 100

Max G score a node may have.


The documentation for this class was generated from the following file: