public static Cell GetNeighborCell(this Cell[,] cells, Cell startCell, Vector2Int direction) { var position = startCell.Position + direction; var isPositionValid = cells.IsPositionValid(position); return(isPositionValid ? cells[position.x, position.y] : null); }