| Parameter | Description |
|---|---|
| left | The NavNode on the left side of the operator. |
| right | The NavNode on the right side of the operator. |
bool
true if the two NavNode values share the same identifier or are both null, false otherwise.
Determines whether two NavNode objects refer to the same NavMesh node.
This operator is a syntactic shortcut equivalent to calling NavNode.Equals. Use it inside expressions where the == syntax is more concise than an explicit method call. Two null NavNode values are considered equal.
Additional resources: NavNode.IsNull
using UnityEngine; using Unity.AI.Navigation.LowLevel; public class NavNodeEqualOperatorExample : MonoBehaviour { NavNode m_Cached; void Update() { using NavWorld world = NavWorld.GetDefaultWorld(); NavLocation current = world.MapLocation(transform.position, Vector3.one, 0); if (current.node == m_Cached) return; m_Cached = current.node; Debug.Log("Agent stepped onto a different NavMesh node."); } }