Editor + runtime tool that generates 2D tile levels with three algorithms and auto-selected walls. Random Walk, Rooms + Corridors, Cellular Automata, sprite profiles, Scene-view live preview.2D Sprite Package NeededBuilding procedural 2D rooms usually means writing the generator, then hand-wiring every wall corner to the right sprite. 2D Map Generator does both. Pick a fill algorithm, link a Tile Set Profile, and the level appears in your Scene view with walls matched to the surrounding floor layout.🎲 Three Generation ModesRandom Walk with configurable walker direction, spawn and removal chancesRooms + Corridors with non-overlapping rooms joined by L-shaped corridorsCellular Automata with smoothing passes and automatic region connectionThe inspector shows only the settings for the active mode⚡ Live PreviewRegenerates in the Scene view as you change settings, seeds, prefabs or profilesPreview objects are not saved into your scene fileClears on entering Play Mode and rebuilds when you returnStops at 10,000 cells and keeps the last valid preview🧱 Automatic Wall PlacementWalls surround every floor, including diagonal-only cornersEach wall stores an eight-neighbor floor maskIsolated single walls are converted to floorFalls back from exact mask to canonical mask to cardinal mask to directional sprite to Generic Wall🎨 Tile Set ProfileA ScriptableObject that stores sprite assignments for Base Wall, Floor, Generic Wall, Wall Up/Down/Left/Right and Wall TopologySeveral sprites per role are chosen at randomYour template prefabs keep their hierarchy, colliders and sortingEditing the profile refreshes every linked generator🔧 Tile Set Builder WindowOpen from Tools > 2D Map Generator > Tile Set BuilderImport existing sliced sprites by dropping textures or spritesVisual 3x3 topology board with filter by mask, hex or direction (N, SE, NW)Floors tab with a gallery and a preview panelSprite palette with a role drop-down per spriteUndo support on assignments🎯 Exact Tile SizingSprite Render Size is set in world unitsCompensates for renderer scaleIndependent of texture Pixels Per UnitPrefab transforms and colliders are not changed📂 Optional Grid Slicing and Prefab BakingSlice an atlas by cell size, offset, spacing and PPUBake one prefab per assigned sprite into a dedicated folderApply baked arrays to a LevelGenerator with Undo🔒 Safety LimitsValidates grid size, probabilities, room settings and prefab arrays before generatingClear console errors instead of silent failuresIteration and work caps prevent runaway generation🌱 Fixed SeedsReproduce the same layout on demandThe previous random state is restored afterwards, so other systems are unaffectedUnity 6.2 or higher (the editor code uses EntityId; please confirm your minimum version)Editor + Runtime4 scripts in the Tbox_2DMapGenerator namespace: LevelGenerator, LevelGeneratorTileSet, and two Editor scripts (LevelGeneratorEditor, LevelGeneratorTileSetEditorWindow)Uses the 2D Sprite package's UnityEditor.U2D.Sprites API for slicingNo external dependenciesMaximum grid: 1024 cells per side, 1,000,000 cells totalPrefab-based spawning with SpriteRenderer sprite overrides


