private void Start() { startingGenerator = FindObjectOfType <TraversalGenerator>(); navMesh = new TraversalAStarNavigation(traversalHolder); selectedLine = traversalHolder.GetRandomLine(); }
private void Update() { if (startingGenerator == null) { startingGenerator = FindObjectOfType <TraversalGenerator>(); } if (getRandomPoint) { selectedLine = traversalHolder.GetRandomLine(); } gen = traversalHolder.GetClosestGenerator(end.position); if (gen) { Vertex vert = traversalHolder.GetMiddleLineForCurrentGenerator(gen).vertex; path = navMesh.GetPathFromTo(traversalHolder.GetMiddleLineForCurrentGenerator(startingGenerator).vertex, vert); } }