Class PathUtil
Provides utility functions for traversing a path
Inheritance
System.Object
PathUtil
Namespace: AnyPath.Graphs
Assembly: Assembly-CSharp.dll
Syntax
public class PathUtil
Methods
| Improve this Doc View SourceTraverse<T>(Vector3, Single, Path<T>, ref Int32)
Similar to Vector3.MoveTowards, but applied to a full path.
Declaration
public static Vector3 Traverse<T>(Vector3 currentPos, float maxDistanceDelta, Path<T> path, ref int currentIndex)
where T : struct, ICorridorSegment
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | currentPos | The current position |
System.Single | maxDistanceDelta | The maximum distance to travel along the path |
Path<T> | path | The path to traverse |
System.Int32 | currentIndex | The current index along the path. This value is modified by this function to represent the new index in the path |
Returns
Type | Description |
---|---|
UnityEngine.Vector3 | The new position along the path |
Type Parameters
Name | Description |
---|---|
T | The of path segments |
Remarks
When currentIndex is equal to the path length, it means the path has been fully traversed
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |