public void CreateCornerData() { Vector3 center = MapSizeData.center; Vector3 extents = MapSizeData.extents; Vector3IntEqualityComparer vector3IntEqualityComparer = new Vector3IntEqualityComparer(); float minX = center.x - extents.x; float maxX = center.x + extents.x; float minZ = center.z - extents.z; float maxZ = center.z + extents.z; CornersByPosition = new Dictionary<Vector3Int, Corner<C>>(vector3IntEqualityComparer); Corners = new Corner<C>[CornerIndexByPosition.Count]; foreach (var kvp in CornerIndexByPosition) { Vector2 normalizedPosition = HexConverter.CornerCoordToNormalizedPosition(kvp.Key, minX, maxX, minZ, maxZ); Corner<C> corner = new Corner<C>(kvp.Key, kvp.Value, normalizedPosition); CornersByPosition.Add(kvp.Key, corner); Corners[corner.Index] = corner; } }