operator !=(Object, Object)
Compares if two objects refer to a different object.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Operator
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static bool operator !=(Object x, Object y)
Parameters
Returns
Type | Description |
|---|---|
| bool |
Examples
using UnityEngine;public class Example : MonoBehaviour{ Transform target; void Update() { // the target object does not refer to the same object as our transform if (target != transform) { print("Another object"); } }}