public static bool operator !=
(Objectx,
Objecty);
Description
比较两个对象是否引用不同的对象。
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");
}
}
}