| Parameter | Description |
|---|---|
| other | A NavNode to compare this one with. |
bool
true if two NavNode objects refer to the same NavMesh node, and false otherwise.
Determines whether this NavNode object refers to the same navigation node as another.
The comparison is performed on the internal identifier of the node. Two NavNode values are equal even if they refer to a node that has since been removed from the NavMesh, because the identifier itself doesn't change. Use NavWorld.IsValid to determine whether the node is still active in the NavMesh world.
using UnityEngine; using Unity.AI.Navigation.LowLevel; public class NavNodeEqualsExample : MonoBehaviour { public Transform other; void Update() { using NavWorld world = NavWorld.GetDefaultWorld(); NavLocation here = world.MapLocation(transform.position, Vector3.one, 0); NavLocation there = world.MapLocation(other.position, Vector3.one, 0); if (here.node.Equals(there.node)) Debug.Log("Both transforms are on the same NavMesh polygon."); } }
| Parameter | Description |
|---|---|
| obj | An object to interpret as a NavNode and to compare this one with. |
bool
true if two NavNode objects refer to the same NavMesh node, and false otherwise.
Determines whether this NavNode object refers to the same navigation node as another.
The comparison is performed on the internal identifier of the node. Two NavNode values are equal even if they refer to a node that has since been removed from the NavMesh, because the identifier itself doesn't change. Use NavWorld.IsValid to determine whether the node is still active in the NavMesh world.
using UnityEngine; using Unity.AI.Navigation.LowLevel; public class NavNodeEqualsExample : MonoBehaviour { public Transform other; void Update() { using NavWorld world = NavWorld.GetDefaultWorld(); NavLocation here = world.MapLocation(transform.position, Vector3.one, 0); NavLocation there = world.MapLocation(other.position, Vector3.one, 0); if (here.node.Equals(there.node)) Debug.Log("Both transforms are on the same NavMesh polygon."); } }