private void CreatePath() { if (!calculated) { switch (PathGeneraor.heuristic) { case HeuristicType.Dijkstra: case HeuristicType.Euclidean: path = PathGeneraor.AlgorithmA(start, end); break; case HeuristicType.Cluster: path = PathGeneraor.Cluster(start, end); break; } calculated = true; } //for (int i = 0; i < path.Count - 1; i++) //{ // path[i].GetComponent<LineRenderer>().enabled = true; // path[i].GetComponent<LineRenderer>().SetPosition(0, path[i].transform.position); // path[i].GetComponent<LineRenderer>().SetPosition(1, path[i + 1].transform.position); //} }
public void FlankIt() { if (target != null) { GameObject go = target.GetComponent <PlayerController>().fleeingNode; ClosestNode(); path = PathGeneraor.Cluster(start, go); } }