美文网首页
Unity SLG Hexagon AStarPath六边形A*

Unity SLG Hexagon AStarPath六边形A*

作者: unlockc | 来源:发表于2022-01-22 11:57 被阅读0次

    此工程非原创,借鉴 如下网站:
    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

    此文章是方便SLG六边形初学者,有一个完整的工程, 能够快速上手。

    1.涉及到的应用点:

    1. 创建六边形组成的世界地图
    2. 六边形AStar寻路

    此例子用Unity2020.3.25f1c1版本演示

    2.上gitee连接:https://gitee.com/chasing2moro/unity-slg-hexagon-algorithm

    3.上效果图

    寻路路线.gif

    工程代码简述:

    1. 六边形基础算法(格子与坐标的转换)
    HexMetrics.cs
    
    1. 创建六边形地图
    HexCell.cs
    Train.cs
    
    1. AStar寻路获取路线
    AStarPath.cs
    MapItem.cs
    
    1. 把路线渲染出来
    LinePath.cs
    

    相关文章

      网友评论

          本文标题:Unity SLG Hexagon AStarPath六边形A*

          本文链接:https://www.haomeiwen.com/subject/bxyuhrtx.html