Пример #1
0
    void RequestPath()
    {
        List <Node> rawPath = pathFinder.GetPath(startPosition, endPosition);

        finalPath = new List <Vector3>();
        finalPath = CleanUpPath(rawPath);
        pathVisualizer.UpdatePath(rawPath);
    }
Пример #2
0
    void ProceedToWaypoint(Vector3 destination)
    {
        List <Node> fullPath        = pathfinder.GetPath(transform.position, destination);
        List <Node> budgetAwarePath = new List <Node>();

        if (fullPath.Count <= availableAP + 1)
        {
            budgetAwarePath    = fullPath;
            destinationReached = true;
        }
        else
        {
            budgetAwarePath = fullPath.GetRange(0, availableAP + 1);
        }
        List <Vector3> currentPath = pathRequester.CleanUpPath(budgetAwarePath);

        Debug.Log(availableAP);
        navAgent.MoveNavAgent(currentPath);
    }