private void CreateCell(int x, int z) { Vector3 position; // ReSharper disable once PossibleLossOfFraction position.x = (x + z * 0.5f - z / 2) * (HexMetrics.InnerRadius * 2f); position.y = 0f; position.z = z * (HexMetrics.OuterRadius * 1.5f); //TODO check position. var cell = new HexCellState { Coordinates = HexCoordinates.FromOffsetCoordinates(x, z), Color = defaultColor, Position = position }; Cells.Add(cell); }
private static int IndexFromHexCoordinates(HexGridDimensions dimensions, HexCoordinates coordinates) { var index = coordinates.X + coordinates.Z * dimensions.Width + coordinates.Z / 2; return(index); }
public static Vector3 ToPosition(HexCoordinates hexCoordinates) { return(Vector3.zero); }