private static int GetDistance(Subregion subA, Subregion subB)
        {
            Node A = PathGrid.NodeAt(subA.AvergX, subA.AvergY);
            Node B = PathGrid.NodeAt(subB.AvergX, subB.AvergY);

            return(RPathfinding.GetDistance(A, B));
        }
示例#2
0
        public static List <Node> GetPath(Vector2Int startPosition, Vector2Int targetPosition)
        {
            var startNode  = PathGrid.NodeAt(startPosition.x, startPosition.y);
            var targetNode = PathGrid.NodeAt(targetPosition.x, targetPosition.y);
            var path       = RPathfinding.GetPath(startNode, targetNode);

            PathHandler?.Invoke(path);
            return(path);
        }