void
GetRemainingPath
(
List<Vector3> | buffer | The buffer will be cleared and replaced with the path. The first point is the current position of the agent. |
List<PathPartWithLinkInfo> | partsBuffer | If not null, this list will be cleared and filled with information about the different parts of the path. A part is a sequence of nodes or an off-mesh link. |
out bool | stale | May be true if the path is invalid in some way. For example if the agent has no path or (for the RichAI/FollowerEntity components only) if the agent has detected that some nodes in the path have been destroyed. |
)
Fills buffer with the remaining path.
var buffer = new List<Vector3>();
var parts = new List<PathPartWithLinkInfo>();
ai.GetRemainingPath(buffer, parts, out bool stale);
foreach (var part in parts) {
for (int i = part.startIndex; i < part.endIndex; i++) {
Debug.DrawLine(buffer[i], buffer[i+1], part.type == Funnel.PartType.NodeSequence ? Color.red : Color.green);
}
}
NoteThe AIPath and AILerp movement scripts do not know about off-mesh links, so the partsBuffer will always be filled with a single node-sequence part.
void
GetRemainingPath
(
List<Vector3> | buffer | The buffer will be cleared and replaced with the path. The first point is the current position of the agent. |
out bool | stale | May be true if the path is invalid in some way. For example if the agent has no path or (for the RichAI/FollowerEntity components only) if the agent has detected that some nodes in the path have been destroyed. |
)
Fills buffer with the remaining path.
var buffer = new List<Vector3>();
ai.GetRemainingPath(buffer, out bool stale);
for (int i = 0; i < buffer.Count - 1; i++) {
Debug.DrawLine(buffer[i], buffer[i+1], Color.red);
}