Navigation.finalPath C# (CSharp) Метод

finalPath() приватный Метод

private finalPath ( Vertex currentVertex ) : List
currentVertex Vertex
Результат List
    private List<Vector3> finalPath(Vertex currentVertex)
    {
        List<Vertex> path = new List<Vertex>();
        while(currentVertex.prev != null) {
            path.Add (currentVertex);
            currentVertex = currentVertex.prev;
        }
        path.Reverse ();

        List<Vector3> positions = new List<Vector3>();
        foreach(Vertex vert in path) {
            positions.Add (vert.myvector);
        }
        return positions;
    }