コード例 #1
0
    public static float CalculatePathLength(this NavMeshAgent navMeshAgent, Vector3 target)
    {
        NavMeshPath path = new NavMeshPath();

        navMeshAgent.CalculatePath(target, path);
        return(path.GetPathLength());
    }