Загрузка данных


private List<Vector2> FindPocketPositions(List<Vector2> bigHexPositions)
{
    float xStep = GetColumnStep(1f);
    float rowStep = GetRowStep(1f);

    Vector2[] neighborOffsets =
    {
        new Vector2(xStep, 0f),
        new Vector2(-xStep, 0f),
        new Vector2(xStep * 0.5f, rowStep),
        new Vector2(-xStep * 0.5f, rowStep),
        new Vector2(xStep * 0.5f, -rowStep),
        new Vector2(-xStep * 0.5f, -rowStep),
    };

    var pockets = new List<Vector2>();

    foreach (Vector2 position in bigHexPositions)
    {
        foreach (Vector2 offset in neighborOffsets)
        {
            Vector2 candidate = position + offset;

            if (HasHexAt(bigHexPositions, candidate, 0.01f))
                continue;

            int neighborCount = CountNeighbors(bigHexPositions, candidate, neighborOffsets, 0.01f);

            if (neighborCount >= 2)
                pockets.Add(candidate);
        }
    }

    return RemoveDuplicates(pockets, 0.01f);
}