Object.operator != 不等于

static operator != (x : Object, y : Object) : bool

Description描述

Compares if two objects refer to a different object

比较如果两个物体不相同。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Transform target;
	void Update() {
		if (target != transform)
			print("Another object");

	}
}
var target : Transform;
function Update () {
	// 如果target 不同于 transform
	if (target != transform) {
		print("Another object");
	}
}
Page last updated: 2010-12-9