コード例 #1
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);
    }