operator ==(NavNode, NavNode)
Determines whether two NavNode objects refer to the same NavMesh node.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Operator
- Namespace: Unity.AI.Navigation.LowLevel
- Assembly: UnityEngine.AIModule
public static bool operator ==(NavNode left, NavNode right)
Parameters
Returns
Type | Description |
|---|---|
| bool | |
Remarks
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
Examples
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."); }}