衬里父母,gatepath

问题描述 投票:0回答:1

有我的astar算法,但我不知道如何获得父亲并从目的地获得快速路线。

Node script methods
getPos()  (Vector2)
Parent  (Node)

Node n = ?.Parent;
while(n != null)
{
    path.add(n.getPos());
    n = n.Parent;
}

enter image description here

a-star
1个回答
0
投票

您必须将“current”设置为相邻节点的父级。然后,如果找到目标,则按照父条目的路径,这是路径

编辑:我也看不到“成本”实施......

© www.soinside.com 2019 - 2024. All rights reserved.