C# Class Pathfinding.MultiTargetPath

Inheritance: ABPath
Afficher le fichier Open project: TruckDefenseInstitute/Convoy Class Usage Examples

Méthodes publiques

Свойство Type Description
callbacks OnPathDelegate[]
chosenTarget int
heuristicMode HeuristicMode
nodePaths List[]
originalTargetPoints Vector3[]
pathsForAll bool
targetNodes GraphNode[]
targetPoints Vector3[]
targetsFound bool[]
vectorPaths List[]

Protected Properties

Свойство Type Description
targetNodeCount int

Méthodes publiques

Méthode Description
ChooseShortestPath ( ) : void

Set chosenTarget to the index of the shortest path

Construct ( Array startPoints, Vector3 target, Array callbackDelegates, OnPathDelegate callback = null ) : MultiTargetPath
Construct ( Vector3 start, Array targets, Array callbackDelegates, OnPathDelegate callback = null ) : MultiTargetPath
MultiTargetPath ( ) : UnityEngine

Default constructor. Do not use this. Instead use the static Construct method which can handle path pooling.

RecalculateHTarget ( bool firstTime ) : void
ResetFlags ( ) : void

Reset flag1 on all nodes after the pathfinding has completed (no matter if an error occurs or if the path is canceled)

SetPathParametersForReturn ( int target ) : void

Méthodes protégées

Méthode Description
CalculateStep ( long targetTick ) : void
Cleanup ( ) : void
FoundTarget ( PathNode nodeR, int i ) : void
Initialize ( ) : void
OnEnterPool ( ) : void
Prepare ( ) : void
RebuildOpenList ( ) : void
Reset ( ) : void
ReturnPath ( ) : void
Setup ( Vector3 start, Array targets, Array callbackDelegates, OnPathDelegate callback ) : void
Trace ( PathNode node ) : void

Private Methods

Méthode Description
DebugString ( PathLog logMode ) : string

Method Details

CalculateStep() protected méthode

protected CalculateStep ( long targetTick ) : void
targetTick long
Résultat void

ChooseShortestPath() public méthode

Set chosenTarget to the index of the shortest path
public ChooseShortestPath ( ) : void
Résultat void

Cleanup() protected méthode

protected Cleanup ( ) : void
Résultat void

Construct() public static méthode

public static Construct ( Array startPoints, Vector3 target, Array callbackDelegates, OnPathDelegate callback = null ) : MultiTargetPath
startPoints Array
target Vector3
callbackDelegates Array
callback OnPathDelegate
Résultat MultiTargetPath

Construct() public static méthode

public static Construct ( Vector3 start, Array targets, Array callbackDelegates, OnPathDelegate callback = null ) : MultiTargetPath
start Vector3
targets Array
callbackDelegates Array
callback OnPathDelegate
Résultat MultiTargetPath

FoundTarget() protected méthode

protected FoundTarget ( PathNode nodeR, int i ) : void
nodeR PathNode
i int
Résultat void

Initialize() protected méthode

protected Initialize ( ) : void
Résultat void

MultiTargetPath() public méthode

Default constructor. Do not use this. Instead use the static Construct method which can handle path pooling.
public MultiTargetPath ( ) : UnityEngine
Résultat UnityEngine

OnEnterPool() protected méthode

protected OnEnterPool ( ) : void
Résultat void

Prepare() protected méthode

protected Prepare ( ) : void
Résultat void

RebuildOpenList() protected méthode

protected RebuildOpenList ( ) : void
Résultat void

RecalculateHTarget() public méthode

public RecalculateHTarget ( bool firstTime ) : void
firstTime bool
Résultat void

Reset() protected méthode

protected Reset ( ) : void
Résultat void

ResetFlags() public méthode

Reset flag1 on all nodes after the pathfinding has completed (no matter if an error occurs or if the path is canceled)
public ResetFlags ( ) : void
Résultat void

ReturnPath() protected méthode

protected ReturnPath ( ) : void
Résultat void

SetPathParametersForReturn() public méthode

public SetPathParametersForReturn ( int target ) : void
target int
Résultat void

Setup() protected méthode

protected Setup ( Vector3 start, Array targets, Array callbackDelegates, OnPathDelegate callback ) : void
start Vector3
targets Array
callbackDelegates Array
callback OnPathDelegate
Résultat void

Trace() protected méthode

protected Trace ( PathNode node ) : void
node PathNode
Résultat void

Property Details

callbacks public_oe property

Callbacks to call for each individual path
public OnPathDelegate[] callbacks
Résultat OnPathDelegate[]

chosenTarget public_oe property

The closest target index (if any target was found)
public int chosenTarget
Résultat int

heuristicMode public_oe property

How to calculate the heuristic. The \link hTarget heuristic target point \endlink can be calculated in different ways, by taking the Average position of all targets, or taking the mid point of them (i.e center of the AABB encapsulating all targets). The one which works best seems to be Sequential, it sets hTarget to the target furthest away, and when that target is found, it moves on to the next one.\n Some modes have the option to be 'moving' (e.g 'MovingAverage'), that means that it is updated every time a target is found.\n The H score is calculated according to AstarPath.heuristic Note: If pathsForAll is false then this option is ignored and it is always treated as being set to None
public HeuristicMode heuristicMode
Résultat HeuristicMode

nodePaths public_oe property

Stores all paths to the targets. Elements are null if no path was found
public List[] nodePaths
Résultat List[]

originalTargetPoints public_oe property

Target points specified when creating the path. These are not snapped to the nearest nodes
public Vector3[] originalTargetPoints
Résultat Vector3[]

pathsForAll public_oe property

If true, a path to all targets will be returned, otherwise just the one to the closest one.
public bool pathsForAll
Résultat bool

targetNodeCount protected_oe property

Number of target nodes left to find
protected int targetNodeCount
Résultat int

targetNodes public_oe property

Nearest nodes to the targetPoints
public GraphNode[] targetNodes
Résultat GraphNode[]

targetPoints public_oe property

Target points specified when creating the path. These are snapped to the nearest nodes
public Vector3[] targetPoints
Résultat Vector3[]

targetsFound public_oe property

Indicates if the target has been found. Also true if the target cannot be reached (is in another area)
public bool[] targetsFound
Résultat bool[]

vectorPaths public_oe property

Stores all vector paths to the targets. Elements are null if no path was found
public List[] vectorPaths
Résultat List[]