Ejemplo n.º 1
0
    public List <Vector3> FindPath(Vector3 start, Vector3 end)
    {
        UnityEngine.Profiling.Profiler.BeginSample("BotAStar.FindPath");
        //ResetDynamicBarriers();
        // set the left bottom corner of map to zero point.
        List <PathNode> path   = _PathFinder.FindPath(ConvertPoint2D(start), ConvertPoint2D(end)); //开始寻径
        var             result = new List <Vector3>();

        if (path == null)
        {
            return(result);
        }
        for (int i = 0, length = path.Count; i < length; i++)
        {
            result.Add(ConvertVector3(path[i]));
        }
        UnityEngine.Profiling.Profiler.EndSample();
        return(result);
    }
Ejemplo n.º 2
0
 List <PathNode> FindPath(Point2D start, Point2D end)
 {
     return(_PathFinder.FindPath(start, end));
 }