Returns a path heading away from a specified point to avoid.
The search will terminate when G > length (passed to the constructor) + FleePath.spread.
Can be used to make an AI to flee from an enemy (cannot guarantee that it will not be forced into corners though :D )
Vector3 thePointToFleeFrom = Vector3.zero;
int theGScoreToStopAt = 10000;
path.aimStrength = 1;
path.spread = 4000;
Seeker seeker = GetComponent<Seeker>();
- A* Pro Feature:
- This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited
The Pro version can be bought here
|
| void | Setup (Vector3 start, Vector3 avoid, int searchLength, OnPathDelegate callback) |
| |
Protected Member Functions inherited from RandomPath |
| override void | CalculateStep (long targetTick) |
| | Calculates the path until completed or until the time has passed targetTick.
|
| |
| override void | Initialize () |
| | Initializes the path.
|
| |
| override void | Prepare () |
| | Prepares the path.
|
| |
| override void | Reset () |
| | Reset all values to their default values.
|
| |
| override void | ReturnPath () |
| | Calls callback to return the calculated path.
|
| |
| RandomPath | Setup (Vector3 start, int length, OnPathDelegate callback) |
| |
| override void | Cleanup () |
| | Always called after the path has been calculated.
|
| |
| virtual void | CompletePathIfStartIsValidTarget () |
| | Checks if the start node is the target and complete the path if that is the case.
|
| |
| virtual bool | EndPointGridGraphSpecialCase (GraphNode closestWalkableEndNode) |
| | Applies a special case for grid nodes.
|
| |
| void | UpdateStartEnd (Vector3 start, Vector3 end) |
| | Sets the start and end points.
|
| |
| void | Setup (Vector3 start, Vector3 end, OnPathDelegate callbackDelegate) |
| |
| void | DebugStringPrefix (PathLog logMode, System.Text.StringBuilder text) |
| | Writes text shared for all overrides of DebugString to the string builder.
|
| |
| void | DebugStringSuffix (PathLog logMode, System.Text.StringBuilder text) |
| | Writes text shared for all overrides of DebugString to the string builder.
|
| |
| virtual void | OnEnterPool () |
| | Called when the path enters the pool.
|
| |
| void | PrepareBase (PathHandler pathHandler) |
| | Prepares low level path variables for calculation.
|
| |
| virtual void | Trace (PathNode from) |
| | Traces the calculated path from the end node to the start.
|
| |