private void CacheNextMiddleEdgeWithOffset(MapElement yMin, MapElement yMax, Vector3 offset, Vector2Int minPos, Vector2Int maxPos) { bool hasMeshElement = (elementEvaluator.IsMeshElement(yMin) || elementEvaluator.IsMeshElement(yMax)); Vector3 wposMin = new Vector3(minPos.x, 0f, minPos.y); edgeCacheMin = edgeCacheMax; if (hasMeshElement && Wall != null) { Wall.PrepareCacheForNextCell(); } if (hasMeshElement && !IsEqual(yMin, yMax)) { if (Wall != null) { vertHasWall.Add(vertices.Count, Wall.VertexCount); } edgeCacheMax = vertices.Count; vertices.Add(ToEdgePosY(wposMin) + offset); if (Wall != null) { Wall.CacheYEdge(ToEdgePosY(wposMin) + offset); } } }