operator !=(NavQueryBuffer, NavQueryBuffer)
Checks whether two NavQueryBuffer values refer to different underlying pathfinding buffers.
Read time 1 minuteLast updated 9 hours ago
Definition
- Type: Operator
- Namespace: Unity.AI.Navigation.LowLevel
- Assembly: UnityEngine.AIModule
public static bool operator !=(NavQueryBuffer left, NavQueryBuffer right)
Parameters
Returns
Type | Description |
|---|---|
| bool | |
Remarks
This operator is a syntactic shortcut equivalent to negating the result of NavQueryBuffer.Equals. Use it inside expressions where the syntax is more concise than an explicit method call. Two buffers created by separate calls to the NavQueryBuffer constructor are always considered different.
!=Examples
using Unity.Collections;using UnityEngine;using Unity.AI.Navigation.LowLevel;// Attach this script to a GameObject and enter Play mode. The Console shows a message because// two separately constructed buffers never share an allocation.public class NavQueryBufferNotEqualOperatorExample : MonoBehaviour{ void OnEnable() { using NavWorld world = NavWorld.GetDefaultWorld(); NavQueryBuffer one = new NavQueryBuffer(world, Allocator.Persistent, 1024); NavQueryBuffer two = new NavQueryBuffer(world, Allocator.Persistent, 1024); if (one != two) Debug.Log("Two separately constructed buffers never share an allocation."); one.Dispose(); two.Dispose(); }}