This is a simple system for creating a hexagonal grid with meshes to get your started.
The system is simple, with no fuss, so you can expand upon as you wish for your own implementations.Did not test on versions other than Unity 6.However, this toolkit is simple and should work on all LTS Unity versions that support the same language level as Unity 6, which I believe is C# 9.This system draws simple meshes for hexagons using geometry. Using these custom meshes, you are significantly reduce the number of batches and draw calls being made to the GPU for rendering. It also allows us to render the meshes statically so they can behave as one, for the purposes of rendering the grid, and lighting calculations. This makes it easier to set up custom baked or dynamic lighting on your scene. Note that you may want to apply your own optimizations, especially when working with large grids dealing with a lot of data.If you want more information on working with hexagonal grids, check out this amazing paper by Amit Patel (https://www.redblobgames.com/grids/hexagons/). It is the source of inspiration for this toolkit.Flexible Coordinate Systems: Supports Axial, Offset, and Cube coordinates, with conversions for grid operations.Grid Types: Generates Rectangular or Radial hex grids.Hex Orientation: Supports Pointy Top and Flat Top orientations.Dynamic Mesh Generation: Creates hexagonal tile and outline meshes based on size and orientation, with adjustable outline thickness.Tile Management: Stores tiles in a dictionary with HexCoord keys.Grid Operations: Includes methods for neighbors, diagonals, distance, range, line drawing, rotation, rings, and spirals, all in cube coordinates.Collision Support: Adds MeshColliders to tiles for raycast-based interaction.Visual Feedback: Highlights selected tiles with customizable colors, reverting to a default color when cleared.Custom Editor: Provides a Unity Editor interface with dropdown for selection mode, range input, center coordinate input, and color fields.Used it to write comments, and several of the details in this publishing. Some boiler-plate was auto-completed, and it assisted greatly with debugging during development.All AI-generated work was manually reviewed and tested.