# Unity SLG Hexagon Algorithm **Repository Path**: phantacix/unity-slg-hexagon-algorithm ## Basic Information - **Project Name**: Unity SLG Hexagon Algorithm - **Description**: Unity SLG游戏六边形算法 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 6 - **Created**: 2025-04-25 - **Last Updated**: 2025-04-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Unity SLG Hexagon Algorithm and AStarPath #### 介绍 Unity SLG游戏六边形算法级AStar寻路 ### 涉及到的应用点: 1. 创建六边形组成的世界地图 2. 六边形AStar寻路 此例子用Unity2020.3.25f1c1版本演示 #### 软件架构 此工程非原创,借鉴 如下网站: https://blog.csdn.net/tqy19921202/article/details/103672024 http://www.cppblog.com/flipcode/archive/2020/01/03/unity_slg.html https://zhuanlan.zhihu.com/p/112849816 ### 效果图 ![寻路路线.gif](https://gitee.com/chasing2moro/unity-slg-hexagon-algorithm/raw/master/Readme/path.gif) ### 工程代码简述: 1. 六边形基础算法(格子与坐标的转换) ``` HexMetrics.cs ``` 2. 创建六边形地图 ``` HexCell.cs Train.cs ``` 3. AStar寻路获取路线 ``` AStarPath.cs MapItem.cs ``` 4. 把路线渲染出来 ``` LinePath.cs ```