I developed this hexagonal map editor in Unity 6 partly as an exploration into how hexagonal maps work in games like the modern Civilization titles, but also to become more familiar with authoring custom tools in Unity.
It consists of the following:
HexagonalMapData: A ScriptableObject implementation to persist cell data (which includes asset references for prefabs to spawn in each cell)HexagonalMap: A MonoBehaviour implementation that handles the grid settings, updates to the shader properties, and updates to the cell dataHexagonalMapEditor: A CustomEditor implementation for HexagonalMap that exposes the grid settings via the inspector and draws previews of content placed in the cellsHexagonalMapEditorWindow: An EditorWindow implementation using the Addressables package for grouping, listing, and selecting prefabs to place in the currently selected cellThe source code is available at github.com/Riari/unity-hex-map-editor.
Here’s a video of the editor in action:
The tile assets I used in this project are from itch.io/dice-lands-hexagon-tile-assets.