/// <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(); } }
public void CreateLevel() { HexTile firstTile = AddTile(Vector3.zero); firstTile.GenerateNeighbors(); }