August 2018
Beginner
334 pages
10h 19m
English
This is a long recipe that can be regarded as a big two-step process: creating the main function and an internal recursive one. Please take into consideration the comments in the code for better understanding of the implementation and code flow:
public List<Vertex> GetPathIDAstar(GameObject srcObj, GameObject dstObj, Heuristic h = null)
{
if (srcObj == null || dstObj == null)
return new List<Vertex>();
if (ReferenceEquals(h, null))
h = EuclidDist;
// next steps;
}
List<Vertex> path = new List<Vertex>(); Vertex src = GetNearestVertex(srcObj.transform.position); Vertex dst = GetNearestVertex(dstObj.transform.position); ...
Read now
Unlock full access