private static Cell ClosestNeighbor(Cell cell) { Cell closestCell = null; float lowerDist = Vector3.Distance(cell.GetCenterPosition(), -cell.GetCenterPosition()); foreach (Cell lCell in cell.Neighbors) { if (Vector3.Distance(cell.GetCenterPosition(), lCell.GetCenterPosition()) < lowerDist) { closestCell = lCell; } } return(closestCell); }
public static List <Vector3> GetPathFromTo(Cell startCell, Cell destinationCell) { bool havePath = false; List <Vector3> path = new List <Vector3>(); path.Add(startCell.GetCenterPosition()); CheckNeighbor(startCell, destinationCell); return(path); }