private void BreadthFirstSearch()
 {
     pathFined.Enqueue(startPoint);
     while (!PathFinded && pathFined.Count > 0)
     {
         currentWayPoint = pathFined.Dequeue();
         HaltIfEndFound();
         ExploreNeighbours();
         currentWayPoint.isExplore = true;
     }
     if (PathFinded)
     {
         CreatePath();
     }
 }
 private void SetAsPath(WayPoint2 wayPoint)
 {
     wayPoint.isPlaceable = false;
     Instantiate(groundLocker, wayPoint.gameObject.transform);
     path.Add(wayPoint);
 }
Ejemplo n.º 3
0
 private void Awake()
 {
     wayPoint = GetComponent <WayPoint2>();
 }