private static void CreateSolidHex(Vector3 hexPosition, float scale, int x, int z, EmptyGrid map) { Color faceColor = map.values[x, z].cellMapColor; foreach (var direction in SolidPointyHexagonData.PossibleDirections()) { if (map.GetNeighbour(x, z, direction, GridType.PointyHex).cellType == CellType.Empty || map.GetNeighbour(x, z, direction, GridType.PointyHex).cellType == CellType.Floor) { int verticesCount; CreateFace(direction, scale, hexPosition, out verticesCount); ColorizeFace(faceColor, verticesCount); } } }
private static void CreateSolidHex(Vector3 hexPosition, float scale, int x, int z, EmptyGrid map, HeightMap heightMap) { Color faceColor = map.values[x, z].cellMapColor; foreach (var direction in SolidPointyHexagonData.PossibleDirections()) { //CellType neighbourType = map.GetNeighbour(x, z, direction, GridType.PointyHex).cellType; //if (neighbourType == CellType.Empty || neighbourType == CellType.Floor || // (neighbourType == CellType.Wall && heightMap.GetNeighbour(x, z, direction, GridType.PointyHex) < heightMap.values[x, z]) // ) if (map.GetNeighbour(x, z, direction, GridType.PointyHex).cellType == CellType.Empty || map.GetNeighbour(x, z, direction, GridType.PointyHex).cellType == CellType.Floor || ((map.GetNeighbour(x, z, direction, GridType.PointyHex).cellType != CellType.Empty && map.GetNeighbour(x, z, direction, GridType.PointyHex).cellType != CellType.Floor) && heightMap.GetNeighbour(x, z, direction, GridType.PointyHex) < heightMap.values[x, z] - epsilon) ) { int verticesCount; CreateFace(direction, scale, hexPosition, out verticesCount); ColorizeFace(faceColor, verticesCount); } } }