void TriangulateCorner(Vector3 bottomVertex, Cell bottomCell, Vector3 leftVertex, Cell leftCell, Vector3 rightVertex, Cell rightCell) { var leftEdgeType = bottomCell.GetEdgeType(leftCell); var rightEdgeType = bottomCell.GetEdgeType(rightCell); if (leftEdgeType == HexagonEdgeType.Slope) { if (rightEdgeType == HexagonEdgeType.Slope) { TriangulateCornerTerraces(bottomVertex, bottomCell, leftVertex, leftCell, rightVertex, rightCell); } else if (rightEdgeType == HexagonEdgeType.Flat) { TriangulateCornerTerraces(leftVertex, leftCell, rightVertex, rightCell, bottomVertex, bottomCell); } else { TriangulateCornerTerracesCliff(bottomVertex, bottomCell, leftVertex, leftCell, rightVertex, rightCell); } } else if (rightEdgeType == HexagonEdgeType.Slope) { if (leftEdgeType == HexagonEdgeType.Flat) { TriangulateCornerTerraces(rightVertex, rightCell, bottomVertex, bottomCell, leftVertex, leftCell); } else { TriangulateCornerCliffTerraces(bottomVertex, bottomCell, leftVertex, leftCell, rightVertex, rightCell); } } else if (leftCell.GetEdgeType(rightCell) == HexagonEdgeType.Slope) { if (leftCell.Elevation < rightCell.Elevation) { TriangulateCornerCliffTerraces(rightVertex, rightCell, bottomVertex, bottomCell, leftVertex, leftCell); } else { TriangulateCornerTerracesCliff(leftVertex, leftCell, rightVertex, rightCell, bottomVertex, bottomCell); } } else { terrain.AddTriangle(bottomVertex, leftVertex, rightVertex); terrain.AddTriangleColor(bottomCell.Color, leftCell.Color, rightCell.Color); } objectManager.AddWall(bottomVertex, bottomCell, leftVertex, leftCell, rightVertex, rightCell); }