Example #1
0
    /// <summary>
    /// Recursively creates new tiles to fill all open neighboring positions up to the level bound edges
    /// </summary>
    public void GenerateNeighbors()
    {
        foreach (Vector3 neighbor in NeighborPositions)
        {
            if (!levelGen.Bounds.Contains(neighbor))
            {
                continue;
            }
            if (GetHex(neighbor, levelGen.transform) != null)
            {
                continue;
            }

            HexTile newHex = levelGen.AddTile(neighbor);
            newHex.GenerateNeighbors();
        }
    }