📅  最后修改于: 2022-03-11 14:49:02.054000             🧑  作者: Mango
private bool SetDestination(Vector3 targetDestination)
{
NavMeshHit hit;
if (NavMesh.SamplePosition(targetDestination, out hit, 1f, NavMesh.AllAreas))
{
agent.SetDestination(hit.position);
return true;
}
return false;
}