如何检查 Unity 中 NavMeshAgent 的路径是否存在到 NavMesh 上的某个点?

How to check if a path exists to certain point on NavMesh for a NavMeshAgent in Unity?

我有一个正在使用 SetDestination() 的 NavMeshAgent,但代理总是试图尽可能靠近目的地,即使该位置无法到达。

尝试使用NavMeshPathStatus.PathComplete检查路径是否在目的地结束。

这是 Unity 对类似问题的回答 https://answers.unity.com/questions/1197626/navmesh-how-to-check-if-full-path-available-c.html