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); }
private void Awake() { wayPoint = GetComponent <WayPoint2>(); }