mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 03:53:04 +00:00
display distance of found path
This commit is contained in:
parent
c258137b70
commit
10d3fe3f0c
1 changed files with 5 additions and 1 deletions
|
@ -302,7 +302,11 @@ namespace SanAndreasUnity.UI {
|
|||
if (NavMesh.CalculatePath(sourcePos, targetPos, -1, path))
|
||||
m_navMeshPathToWaypoint = path.corners;
|
||||
|
||||
Debug.Log($"Nav mesh path calculation done - status {path.status}, num corners {m_navMeshPathToWaypoint?.Length ?? 0}, time {sw.Elapsed.TotalMilliseconds} ms");
|
||||
Debug.Log($"Nav mesh path calculation done - " +
|
||||
$"status {path.status}, " +
|
||||
$"num corners {m_navMeshPathToWaypoint?.Length ?? 0}, " +
|
||||
$"total distance {m_navMeshPathToWaypoint?.Skip(1).Select((corner, i) => Vector3.Distance(corner, m_navMeshPathToWaypoint[i])).Sum()}, " +
|
||||
$"time {sw.Elapsed.TotalMilliseconds} ms");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue